Interface Path2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>
-
- Type Parameters:
ST- is the type of the general implementation.IT- is the type of the implementation of this shape.IE- is the type of the path elements.P- is the type of the points.V- is the type of the vectors.B- is the type of the bounding boxes.
- All Superinterfaces:
Cloneable,JsonableObject,Path2D<ST,IT,PathIterator2ai<IE>,P,V,B>,Serializable,Shape2ai<ST,IT,IE,P,V,B>,Shape2D<ST,IT,PathIterator2ai<IE>,P,V,B>
public interface Path2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>> extends Shape2ai<ST,IT,IE,P,V,B>, Path2D<ST,IT,PathIterator2ai<IE>,P,V,B>
Fonctional interface that represented a 2D path on a plane.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND, Hamza JAFFALI
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classPath2ai.AbstractPathIterator<E extends PathElement2ai>An abstract path iterator.static classPath2ai.FlatteningPathIterator<E extends PathElement2ai>A path iterator that is flattening the path.static classPath2ai.PathPathIterator<E extends PathElement2ai>A path iterator that does not transform the coordinates.static classPath2ai.PixelIterator<P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>Iterator on the pixels of the path.static classPath2ai.PrivateAPIPrivate API for Path2ai.static classPath2ai.TransformedPathIterator<E extends PathElement2ai>A path iterator that transforms the coordinates.-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.Path2D
Path2D.ArcType
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_FLATTENING_LIMITDefault depth for the flattening of the path.static PathWindingRuleDEFAULT_WINDING_RULEThe default winding rule:PathWindingRule.NON_ZERO.static intGROW_SIZEMultiple of cubic & quad curve size.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidadd(Iterator<? extends PathElement2ai> iterator)Add the elements replied by the iterator into this path.default voidarcTo(int ctrlx, int ctrly, int tox, int toy)Adds a section of an shallow ellipse to the current path.default voidarcTo(int tox, int toy, int radiusx, int radiusy, double xAxisRotation, boolean largeArcFlag, boolean sweepFlag)Adds a section of an shallow ellipse to the current path.default voidarcTo(int ctrlx, int ctrly, int tox, int toy, double tfrom, double tto, Path2D.ArcType type)Adds a section of an shallow ellipse to the current path.default voidarcTo(Point2D<?,?> ctrl, Point2D<?,?> to, double tfrom, double tto, Path2D.ArcType type)Adds a section of an shallow ellipse to the current path.default voidarcTo(Point2D<?,?> to, Vector2D<?,?> radii, double xAxisRotation, boolean largeArcFlag, boolean sweepFlag)Adds a section of an shallow ellipse to the current path.static booleancalculatesControlPointBoundingBox(PathIterator2ai<?> iterator, Rectangle2ai<?,?,?,?,?,?> box)Compute the box that corresponds to the control points of the path.static intcalculatesCrossingsPathIteratorCircleShadow(int crossings, PathIterator2ai<?> pi, int cx, int cy, int radius, CrossingComputationType type)Calculates the number of times the given path crosses the given circle extending to the right.static intcalculatesCrossingsPathIteratorPathShadow(int crossings, PathIterator2ai<?> iterator, BasicPathShadow2ai shadow, CrossingComputationType type)Accumulate the number of times the path crosses the shadow extending to the right of the second path.static intcalculatesCrossingsPathIteratorPointShadow(int crossings, PathIterator2ai<?> pi, int px, int py, CrossingComputationType type)Calculates the number of times the given path crosses the ray extending to the right from (px, py).static intcalculatesCrossingsPathIteratorRectangleShadow(int crossings, PathIterator2ai<?> pi, int rxmin, int rymin, int rxmax, int rymax, CrossingComputationType type)Accumulate the number of times the path crosses the shadow extending to the right of the rectangle.static intcalculatesCrossingsPathIteratorSegmentShadow(int crossings, PathIterator2ai<?> pi, int x1, int y1, int x2, int y2, CrossingComputationType type)Calculates the number of times the given path crosses the given circle extending to the right.static booleancalculatesDrawableElementBoundingBox(PathIterator2ai<?> iterator, Rectangle2ai<?,?,?,?,?,?> box)Compute the box that corresponds to the drawable elements of the path.default booleancontains(int x, int y)Replies if the given point is inside this shape.default booleancontains(Rectangle2ai<?,?,?,?,?,?> box)Replies if the given rectangle is inside this shape.static booleancontainsPoint(PathIterator2ai<?> pi, int x, int y)Tests if the specified coordinates are inside the closed boundary of the specifiedPathIterator2ai.static booleancontainsRectangle(PathIterator2ai<?> pi, int rx, int ry, int rwidth, int rheight)Tests if the specified rectangle is inside the closed boundary of the specifiedPathIterator2ai.voidcurveTo(int x1, int y1, int x2, int y2, int x3, int y3)Adds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the specified coordinates(x3, y3), using the specified points(x1, y1)and(x2, y2)as Bézier control points.default voidcurveTo(Point2D<?,?> ctrl1, Point2D<?,?> ctrl2, Point2D<?,?> to)Adds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the specified coordinates(x3, y3), using the specified points(x1, y1)and(x2, y2)as Bézier control points.default booleanequalsToShape(IT shape)Replies this shape is equal to the given shape.static booleanfindsClosestPointPathIteratorPathIterator(PathIterator2ai<? extends PathElement2ai> pi, PathIterator2ai<? extends PathElement2ai> shape, Point2D<?,?> result)Replies the point on the path of pi that is closest to the given shape.static voidfindsClosestPointPathIteratorPoint(PathIterator2ai<? extends PathElement2ai> pi, int x, int y, Point2D<?,?> result)Replies the point on the path that is closest to the given point.static voidfindsFarthestPointPathIteratorPoint(PathIterator2ai<? extends PathElement2ai> pi, int x, int y, Point2D<?,?> result)Replies the point on the path that is farthest to the given point.default PgetClosestPointTo(Circle2ai<?,?,?,?,?,?> circle)Replies the closest point on this shape to the given rectangle.default PgetClosestPointTo(Path2ai<?,?,?,?,?,?> path)Replies the closest point on this shape to the given rectangle.default PgetClosestPointTo(Rectangle2ai<?,?,?,?,?,?> rectangle)Replies the closest point on this shape to the given rectangle.default PgetClosestPointTo(Segment2ai<?,?,?,?,?,?> segment)Replies the closest point on this shape to the given rectangle.default PgetClosestPointTo(Point2D<?,?> pt)Replies the point on the shape that is closest to the given point.intgetCoordAt(int index)Replies the coordinate at the given index.default PgetCurrentPoint()Replies the last point in the path.intgetCurrentX()Replies the x coordinate of the last point in the path.intgetCurrentY()Replies the x coordinate of the last point in the path.default doublegetDistanceL1(Point2D<?,?> pt)Computes the L-1 (Manhattan) distance between this shape and point p1.default doublegetDistanceLinf(Point2D<?,?> pt)Computes the L-infinite distance between this shape and point p1.default doublegetDistanceSquared(Point2D<?,?> pt)Replies the squared value of the minimal distance from this shape to the given point.default PgetFarthestPointTo(Point2D<?,?> pt)Replies the point on the shape that is farthest the given point.default PathIterator2ai<IE>getFlatteningPathIterator()Replies a path iterator on this shape that is replacing the curves by line approximations.default doublegetLengthSquared()Replies the total squared length of the path.default PathIterator2ai<IE>getPathIterator(double flatness)Replies an iterator on the path elements.default PathIterator2ai<IE>getPathIterator(Transform2D transform)Replies the elements of the paths.default Iterator<P>getPointIterator()Replies an iterator on the points covered by the perimeter of this shape.default booleanintersects(Circle2ai<?,?,?,?,?,?> circle)Replies if this shape is intersecting the given circle.default booleanintersects(MultiShape2ai<?,?,?,?,?,?,?> multishape)Replies if this shape is intersecting the given multishape.default booleanintersects(PathIterator2ai<?> iterator)Replies if this shape is intersecting the path described by the given iterator.default booleanintersects(Rectangle2ai<?,?,?,?,?,?> rectangle)Replies if this shape is intersecting the given rectangle.default booleanintersects(Segment2ai<?,?,?,?,?,?> segment)Replies if this shape is intersecting the given segment.static booleanintersectsRectangle(PathIterator2ai<?> pi, int x, int y, int width, int height)Tests if the interior of the specifiedPathIterator2aiintersects the interior of a specified set of rectangular coordinates.voidlineTo(int x, int y)Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in double precision.default voidlineTo(Point2D<?,?> to)Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in double precision.voidmoveTo(int x, int y)Adds a point to the path by moving to the specified coordinates specified in double precision.default voidmoveTo(Point2D<?,?> position)Adds a point to the path by moving to the specified coordinates specified in double precision.default voidmoveToIfFar(int x, int y)Adds a point to the path by moving to the specified coordinates specified in double precision if and only if the current position does not corresponds to the given position.default voidmoveToIfFar(Point2D<?,?> position)Adds a point to the path by moving to the specified coordinates specified in double precision.voidquadTo(int x1, int y1, int x2, int y2)Adds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the specified coordinates(x2, y2), using the specified point(x1, y1)as a quadratic parametric control point.default voidquadTo(Point2D<?,?> ctrl, Point2D<?,?> to)Adds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the specified coordinates(x2, y2), using the specified point(x1, y1)as a quadratic parametric control point.booleanremove(int x, int y)Remove the point with the given coordinates.default voidset(Path2ai<?,?,?,?,?,?> path)Set the path.voidsetLastPoint(int x, int y)Change the coordinates of the last inserted point.default voidsetLastPoint(Point2D<?,?> point)Change the coordinates of the last inserted point.default Collection<P>toCollection()Replies the collection that is contains all the points of the path.voidtransform(Transform2D transform)Transform the current path.-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Path2D
arcTo, closePath, containsControlPoint, getLength, getPathElementCount, getPathElementTypeAt, getPointAt, getWindingRule, isCurved, isMultiParts, isPolygon, isPolyline, removeLast, setWindingRule, size, toBoundingBoxWithCtrlPoints, toBoundingBoxWithCtrlPoints, toDoubleArray, toDoubleArray, toFloatArray, toFloatArray, toIntArray, toIntArray, toPointArray, toPointArray
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.ai.Shape2ai
contains, contains, createTransformedShape, getClosestPointTo, getClosestPointTo, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getGeomFactory, intersects, intersects, toBoundingBox, translate, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Shape2D
clear, clone, equalsToPathIterator, getDistance, getDistance, getPathIterator, isEmpty, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo, set, toBoundingBox
-
-
-
-
Field Detail
-
GROW_SIZE
static final int GROW_SIZE
Multiple of cubic & quad curve size.- See Also:
- Constant Field Values
-
DEFAULT_FLATTENING_LIMIT
static final int DEFAULT_FLATTENING_LIMIT
Default depth for the flattening of the path.- See Also:
- Constant Field Values
-
DEFAULT_WINDING_RULE
static final PathWindingRule DEFAULT_WINDING_RULE
The default winding rule:PathWindingRule.NON_ZERO.
-
-
Method Detail
-
calculatesDrawableElementBoundingBox
static boolean calculatesDrawableElementBoundingBox(PathIterator2ai<?> iterator, Rectangle2ai<?,?,?,?,?,?> box)
Compute the box that corresponds to the drawable elements of the path.An element is drawable if it is a line, a curve, or a closing path element.
- Parameters:
iterator- the iterator on the path elements.box- the box to set.- Returns:
trueif a drawable element was found.
-
calculatesControlPointBoundingBox
static boolean calculatesControlPointBoundingBox(PathIterator2ai<?> iterator, Rectangle2ai<?,?,?,?,?,?> box)
Compute the box that corresponds to the control points of the path.An element is drawable if it is a line, a curve, or a closing path element. The box fits the drawn lines and the drawn curves. The control points of the curves may be outside the output box. For obtaining the bounding box of the drawn lines and cruves, use
calculatesDrawableElementBoundingBox(PathIterator2ai, Rectangle2ai).- Parameters:
iterator- the iterator on the path elements.box- the box to set.- Returns:
trueif a control point was found.- See Also:
calculatesDrawableElementBoundingBox(PathIterator2ai, Rectangle2ai)
-
calculatesCrossingsPathIteratorSegmentShadow
static int calculatesCrossingsPathIteratorSegmentShadow(int crossings, PathIterator2ai<?> pi, int x1, int y1, int x2, int y2, CrossingComputationType type)Calculates the number of times the given path crosses the given circle extending to the right.- Parameters:
crossings- is the initial value for crossing.pi- is the description of the path.x1- is the first point of the segment.y1- is the first point of the segment.x2- is the first point of the segment.y2- is the first point of the segment.type- is the type of special computation to apply. Ifnull, it is equivalent toCrossingComputationType.STANDARD.- Returns:
- the crossing
-
calculatesCrossingsPathIteratorCircleShadow
static int calculatesCrossingsPathIteratorCircleShadow(int crossings, PathIterator2ai<?> pi, int cx, int cy, int radius, CrossingComputationType type)Calculates the number of times the given path crosses the given circle extending to the right.- Parameters:
crossings- is the initial value for crossing.pi- is the description of the path.cx- is the center of the circle.cy- is the center of the circle.radius- is the radius of the circle.type- is the type of special computation to apply. Ifnull, it is equivalent toCrossingComputationType.STANDARD.- Returns:
- the crossing
-
calculatesCrossingsPathIteratorPointShadow
static int calculatesCrossingsPathIteratorPointShadow(int crossings, PathIterator2ai<?> pi, int px, int py, CrossingComputationType type)Calculates the number of times the given path crosses the ray extending to the right from (px, py). If the point lies on a part of the path, then no crossings are counted for that intersection. +1 is added for each crossing where the Y coordinate is increasing -1 is added for each crossing where the Y coordinate is decreasing The return value is the sum of all crossings for every segment in the path. The path must start with a MOVE_TO, otherwise an exception is thrown.- Parameters:
crossings- the initial crossing.pi- is the description of the path.px- is the reference point to test.py- is the reference point to test.type- is the type of special computation to apply. Ifnull, it is equivalent toCrossingComputationType.STANDARD.- Returns:
- the crossing, or
GeomConstants.SHAPE_INTERSECTS
-
calculatesCrossingsPathIteratorPathShadow
static int calculatesCrossingsPathIteratorPathShadow(int crossings, PathIterator2ai<?> iterator, BasicPathShadow2ai shadow, CrossingComputationType type)Accumulate the number of times the path crosses the shadow extending to the right of the second path. See the comment for the SHAPE_INTERSECTS constant for more complete details. The return value is the sum of all crossings for both the top and bottom of the shadow for every segment in the path, or the special value SHAPE_INTERSECTS if the path ever enters the interior of the rectangle. The path must start with a SEG_MOVETO, otherwise an exception is thrown. The caller must check r[xy]{min, max} for NaN values.- Parameters:
crossings- the initial crossing.iterator- is the iterator on the path elements.shadow- is the description of the shape to project to the right.type- is the type of special computation to apply. Ifnull, it is equivalent toCrossingComputationType.STANDARD.- Returns:
- the crossings.
- See Also:
- "WeilerâAtherton clipping algorithm"
-
containsPoint
static boolean containsPoint(PathIterator2ai<?> pi, int x, int y)
Tests if the specified coordinates are inside the closed boundary of the specifiedPathIterator2ai.This method provides a basic facility for implementors of the
Shape2aiinterface to implement support for theShape2ai.contains(int, int)method.- Parameters:
pi- the specifiedPathIterator2fx- the specified X coordinatey- the specified Y coordinate- Returns:
trueif the specified coordinates are inside the specifiedPathIterator2f;falseotherwise
-
containsRectangle
static boolean containsRectangle(PathIterator2ai<?> pi, int rx, int ry, int rwidth, int rheight)
Tests if the specified rectangle is inside the closed boundary of the specifiedPathIterator2ai.The points on the path are assumed to be outside the path area. It means that is the rectangle is intersecting the path, this function replies
false.- Parameters:
pi- the specifiedPathIterator2airx- the lowest corner of the rectangle.ry- the lowest corner of the rectangle.rwidth- is the width of the rectangle.rheight- is the width of the rectangle.- Returns:
trueif the specified rectangle is inside the specifiedPathIterator2f;falseotherwise.
-
contains
@Pure default boolean contains(Rectangle2ai<?,?,?,?,?,?> box)
Description copied from interface:Shape2aiReplies if the given rectangle is inside this shape.- Specified by:
containsin interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
box- the rectangle to test.- Returns:
trueif the given box is inside the shape.
-
contains
default boolean contains(int x, int y)Description copied from interface:Shape2aiReplies if the given point is inside this shape.- Specified by:
containsin interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
x- x coordinate of the point to test.y- y coordinate of the point to test.- Returns:
trueif the given point is inside this shape, otherwisefalse.
-
calculatesCrossingsPathIteratorRectangleShadow
static int calculatesCrossingsPathIteratorRectangleShadow(int crossings, PathIterator2ai<?> pi, int rxmin, int rymin, int rxmax, int rymax, CrossingComputationType type)Accumulate the number of times the path crosses the shadow extending to the right of the rectangle. See the comment for the SHAPE_INTERSECTS constant for more complete details. The return value is the sum of all crossings for both the top and bottom of the shadow for every segment in the path, or the special value SHAPE_INTERSECTS if the path ever enters the interior of the rectangle. The path must start with a SEG_MOVETO, otherwise an exception is thrown. The caller must check r[xy]{min, max} for NaN values.- Parameters:
crossings- the initial crossing.pi- is the iterator on the path elements.rxmin- is the first corner of the rectangle.rymin- is the first corner of the rectangle.rxmax- is the second corner of the rectangle.rymax- is the second corner of the rectangle.type- is the type of special computation to apply. Ifnull, it is equivalent toCrossingComputationType.STANDARD.- Returns:
- the crossings.
-
intersectsRectangle
static boolean intersectsRectangle(PathIterator2ai<?> pi, int x, int y, int width, int height)
Tests if the interior of the specifiedPathIterator2aiintersects the interior of a specified set of rectangular coordinates.This method provides a basic facility for implementors of the
Shape2aiinterface to implement support for theintersects()method.This method object may conservatively return true in cases where the specified rectangular area intersects a segment of the path, but that segment does not represent a boundary between the interior and exterior of the path. Such a case may occur if some set of segments of the path are retraced in the reverse direction such that the two sets of segments cancel each other out without any interior area between them. To determine whether segments represent true boundaries of the interior of the path would require extensive calculations involving all of the segments of the path and the winding rule and are thus beyond the scope of this implementation.
- Parameters:
pi- the specifiedPathIteratorx- the specified X coordinatey- the specified Y coordinatewidth- the width of the specified rectangular coordinatesheight- the height of the specified rectangular coordinates- Returns:
trueif the specifiedPathIteratorand the interior of the specified set of rectangular coordinates intersect each other;falseotherwise.
-
intersects
@Pure default boolean intersects(Circle2ai<?,?,?,?,?,?> circle)
Description copied from interface:Shape2aiReplies if this shape is intersecting the given circle.- Specified by:
intersectsin interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
circle- the circle.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Rectangle2ai<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape2aiReplies if this shape is intersecting the given rectangle.- Specified by:
intersectsin interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
rectangle- the rectangle.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Segment2ai<?,?,?,?,?,?> segment)
Description copied from interface:Shape2aiReplies if this shape is intersecting the given segment.- Specified by:
intersectsin interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
segment- the segment.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
default boolean intersects(PathIterator2ai<?> iterator)
Description copied from interface:Shape2aiReplies if this shape is intersecting the path described by the given iterator.- Specified by:
intersectsin interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
iterator- the path iterator.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(MultiShape2ai<?,?,?,?,?,?,?> multishape)
Description copied from interface:Shape2aiReplies if this shape is intersecting the given multishape.- Specified by:
intersectsin interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
multishape- the multishape.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
findsClosestPointPathIteratorPoint
static void findsClosestPointPathIteratorPoint(PathIterator2ai<? extends PathElement2ai> pi, int x, int y, Point2D<?,?> result)
Replies the point on the path that is closest to the given point.CAUTION: This function works only on path iterators that are replying polyline primitives, ie. if the
PathIterator2D.isPolyline()ofpiis replyingtrue.getClosestPointTo(Point2D)avoids this restriction.- Parameters:
pi- is the iterator on the elements of the path.x- x coordinate of the point.y- y coordinate of the point.result- the closest point on the shape; or the point itself if it is inside the shape.
-
findsClosestPointPathIteratorPathIterator
static boolean findsClosestPointPathIteratorPathIterator(PathIterator2ai<? extends PathElement2ai> pi, PathIterator2ai<? extends PathElement2ai> shape, Point2D<?,?> result)
Replies the point on the path of pi that is closest to the given shape.CAUTION: This function works only on path iterators that are replying not-curved primitives, ie. if the
PathIterator2D.isCurved()ofpiis replyingfalse.- Parameters:
pi- is the iterator of path elements, on one of which the closest point is located.shape- the shape to which the closest point must be computed.result- the closest point on pi.- Returns:
trueif a point was found. Otherwisefalse.
-
getClosestPointTo
default P getClosestPointTo(Point2D<?,?> pt)
Description copied from interface:Shape2DReplies the point on the shape that is closest to the given point.- Specified by:
getClosestPointToin interfaceShape2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
pt- the point.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getClosestPointTo
default P getClosestPointTo(Rectangle2ai<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape2aiReplies the closest point on this shape to the given rectangle.- Specified by:
getClosestPointToin interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
rectangle- the rectangle.- Returns:
- the closest point on this shape to the given shape; or the point if the point is in this shape.
-
getClosestPointTo
default P getClosestPointTo(Circle2ai<?,?,?,?,?,?> circle)
Description copied from interface:Shape2aiReplies the closest point on this shape to the given rectangle.- Specified by:
getClosestPointToin interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
circle- the circle.- Returns:
- the closest point on this shape to the given shape; or the point if the point is in this shape.
-
getClosestPointTo
default P getClosestPointTo(Segment2ai<?,?,?,?,?,?> segment)
Description copied from interface:Shape2aiReplies the closest point on this shape to the given rectangle.- Specified by:
getClosestPointToin interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
segment- the segment.- Returns:
- the closest point on this shape to the given shape; or the point if the point is in this shape.
-
getClosestPointTo
default P getClosestPointTo(Path2ai<?,?,?,?,?,?> path)
Description copied from interface:Shape2aiReplies the closest point on this shape to the given rectangle.- Specified by:
getClosestPointToin interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
path- the path.- Returns:
- the closest point on this shape to the given shape; or the point if the point is in this shape.
-
findsFarthestPointPathIteratorPoint
static void findsFarthestPointPathIteratorPoint(PathIterator2ai<? extends PathElement2ai> pi, int x, int y, Point2D<?,?> result)
Replies the point on the path that is farthest to the given point.CAUTION: This function works only on path iterators that are replying polyline primitives, ie. if the
PathIterator2D.isPolyline()ofpiis replyingtrue.getFarthestPointTo(Point2D)avoids this restriction.- Parameters:
pi- is the iterator on the elements of the path.x- x coordinate of the point.y- y coordinate of the point.result- the farthest point on the shape.
-
getFarthestPointTo
default P getFarthestPointTo(Point2D<?,?> pt)
Description copied from interface:Shape2DReplies the point on the shape that is farthest the given point.- Specified by:
getFarthestPointToin interfaceShape2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
pt- the point.- Returns:
- the farthest point on the shape.
-
equalsToShape
@Pure default boolean equalsToShape(IT shape)
Description copied from interface:Shape2DReplies this shape is equal to the given shape.- Specified by:
equalsToShapein interfaceShape2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
shape- the shape to compare to.- Returns:
trueif this shape is equal is equal to the given path.
-
add
default void add(Iterator<? extends PathElement2ai> iterator)
Add the elements replied by the iterator into this path.- Parameters:
iterator- the iterator on the elements to add.
-
set
default void set(Path2ai<?,?,?,?,?,?> path)
Set the path.- Parameters:
path- the path to copy.
-
moveTo
void moveTo(int x, int y)Adds a point to the path by moving to the specified coordinates specified in double precision.- Parameters:
x- the specified X coordinatey- the specified Y coordinate
-
moveTo
default void moveTo(Point2D<?,?> position)
Description copied from interface:Path2DAdds a point to the path by moving to the specified coordinates specified in double precision.- Specified by:
moveToin interfacePath2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
position- the new position.
-
moveToIfFar
default void moveToIfFar(int x, int y)Adds a point to the path by moving to the specified coordinates specified in double precision if and only if the current position does not corresponds to the given position.- Parameters:
x- the specified X coordinatey- the specified Y coordinate- Since:
- 14.0
-
moveToIfFar
default void moveToIfFar(Point2D<?,?> position)
Description copied from interface:Path2DAdds a point to the path by moving to the specified coordinates specified in double precision.- Specified by:
moveToIfFarin interfacePath2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
position- the new position.
-
lineTo
void lineTo(int x, int y)Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in double precision.- Parameters:
x- the specified X coordinatey- the specified Y coordinate
-
lineTo
default void lineTo(Point2D<?,?> to)
Description copied from interface:Path2DAdds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in double precision.- Specified by:
lineToin interfacePath2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
to- the end point
-
quadTo
void quadTo(int x1, int y1, int x2, int y2)Adds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the specified coordinates(x2, y2), using the specified point(x1, y1)as a quadratic parametric control point. All coordinates are specified in double precision.- Parameters:
x1- the X coordinate of the quadratic control pointy1- the Y coordinate of the quadratic control pointx2- the X coordinate of the final end pointy2- the Y coordinate of the final end point
-
quadTo
default void quadTo(Point2D<?,?> ctrl, Point2D<?,?> to)
Description copied from interface:Path2DAdds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the specified coordinates(x2, y2), using the specified point(x1, y1)as a quadratic parametric control point. All coordinates are specified in double precision.- Specified by:
quadToin interfacePath2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
ctrl- the quadratic control pointto- the final end point
-
curveTo
void curveTo(int x1, int y1, int x2, int y2, int x3, int y3)Adds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the specified coordinates(x3, y3), using the specified points(x1, y1)and(x2, y2)as Bézier control points. All coordinates are specified in double precision.- Parameters:
x1- the X coordinate of the first Bézier control pointy1- the Y coordinate of the first Bézier control pointx2- the X coordinate of the second Bézier control pointy2- the Y coordinate of the second Bézier control pointx3- the X coordinate of the final end pointy3- the Y coordinate of the final end point
-
curveTo
default void curveTo(Point2D<?,?> ctrl1, Point2D<?,?> ctrl2, Point2D<?,?> to)
Description copied from interface:Path2DAdds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the specified coordinates(x3, y3), using the specified points(x1, y1)and(x2, y2)as Bézier control points. All coordinates are specified in double precision.- Specified by:
curveToin interfacePath2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
ctrl1- the first Bézier control pointctrl2- the second Bézier control pointto- the final end point
-
arcTo
default void arcTo(int ctrlx, int ctrly, int tox, int toy, double tfrom, double tto, Path2D.ArcType type)Adds a section of an shallow ellipse to the current path. The ellipse from which a quadrant is taken is the ellipse that would be inscribed in a parallelogram defined by 3 points, The current point which is considered to be the midpoint of the edge leading into the corner of the ellipse where the ellipse grazes it,(ctrlx, ctrly)which is considered to be the location of the corner of the parallelogram in which the ellipse is inscribed, and(tox, toy)which is considered to be the midpoint of the edge leading away from the corner of the oval where the oval grazes it.
Only the portion of the ellipse from
tfromtottowill be included where0frepresents the point where the ellipse grazes the leading edge,1frepresents the point where the oval grazes the trailing edge, and0.5frepresents the point on the oval closest to the control point. The two values must satisfy the relation(0 <= tfrom <= tto <= 1).If
tfromis not0fthen the caller would most likely want to use one of the arctypevalues that inserts a segment leading to the initial point. An initialmoveTo(int, int)orlineTo(int, int)can be added to direct the path to the starting point of the ellipse section ifPath2D.ArcType.MOVE_THEN_ARCorPath2D.ArcType.LINE_THEN_ARCare specified by the type argument. ThelineTopath segment will only be added if the current point is not already at the indicated location to avoid spurious empty line segments. The type can be specified asPath2D.ArcType.ARC_ONLYif the current point on the path is known to be at the starting point of the ellipse section.- Parameters:
ctrlx- the x coordinate of the control point, i.e. the corner of the parallelogram in which the ellipse is inscribed.ctrly- the y coordinate of the control point, i.e. the corner of the parallelogram in which the ellipse is inscribed.tox- the x coordinate of the target point.toy- the y coordinate of the target point.tfrom- the fraction of the ellipse section where the curve should start.tto- the fraction of the ellipse section where the curve should endtype- the specification of what additional path segments should be appended to lead the current path to the starting point.
-
arcTo
default void arcTo(Point2D<?,?> ctrl, Point2D<?,?> to, double tfrom, double tto, Path2D.ArcType type)
Description copied from interface:Path2DAdds a section of an shallow ellipse to the current path. The ellipse from which a quadrant is taken is the ellipse that would be inscribed in a parallelogram defined by 3 points, The current point which is considered to be the midpoint of the edge leading into the corner of the ellipse where the ellipse grazes it,(ctrlx, ctrly)which is considered to be the location of the corner of the parallelogram in which the ellipse is inscribed, and(tox, toy)which is considered to be the midpoint of the edge leading away from the corner of the oval where the oval grazes it.
Only the portion of the ellipse from
tfromtottowill be included where0frepresents the point where the ellipse grazes the leading edge,1frepresents the point where the oval grazes the trailing edge, and0.5frepresents the point on the oval closest to the control point. The two values must satisfy the relation(0 <= tfrom <= tto <= 1).If
tfromis not0fthen the caller would most likely want to use one of the arctypevalues that inserts a segment leading to the initial point. An initialPath2D.moveTo(Point2D)orPath2D.lineTo(Point2D)can be added to direct the path to the starting point of the ellipse section ifPath2D.ArcType.MOVE_THEN_ARCorPath2D.ArcType.LINE_THEN_ARCare specified by the type argument. ThelineTopath segment will only be added if the current point is not already at the indicated location to avoid spurious empty line segments. The type can be specified asPath2D.ArcType.ARC_ONLYif the current point on the path is known to be at the starting point of the ellipse section.- Specified by:
arcToin interfacePath2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
ctrl- the control point, i.e. the corner of the parallelogram in which the ellipse is inscribed.to- the target point.tfrom- the fraction of the ellipse section where the curve should start.tto- the fraction of the ellipse section where the curve should endtype- the specification of what additional path segments should be appended to lead the current path to the starting point.
-
arcTo
default void arcTo(int ctrlx, int ctrly, int tox, int toy)Adds a section of an shallow ellipse to the current path.This function is equivalent to:
this.arcTo(ctrlx, ctrly, tox, toy, 0.0, 1.0, ArcType.ARCONLY);- Parameters:
ctrlx- the x coordinate of the control point, i.e. the corner of the parallelogram in which the ellipse is inscribed.ctrly- the y coordinate of the control point, i.e. the corner of the parallelogram in which the ellipse is inscribed.tox- the x coordinate of the target point.toy- the y coordinate of the target point.
-
arcTo
default void arcTo(Point2D<?,?> to, Vector2D<?,?> radii, double xAxisRotation, boolean largeArcFlag, boolean sweepFlag)
Description copied from interface:Path2DAdds a section of an shallow ellipse to the current path. The ellipse from which the portions are extracted follows the rules:- The ellipse will have its X axis tilted from horizontal by the
angle
xAxisRotationspecified in radians. - The ellipse will have the X and Y radii (viewed from its tilted
coordinate system) specified by
radiusxandradiusyunless that ellipse is too small to bridge the gap from the current point to the specified destination point in which case a larger ellipse with the same ratio of dimensions will be substituted instead. - The ellipse may slide perpendicular to the direction from the current point to the specified destination point so that it just touches the two points. The direction it slides (to the "left" or to the "right") will be chosen to meet the criteria specified by the two boolean flags as described below. Only one direction will allow the method to meet both criteria.
- If the
largeArcFlagis true, then the ellipse will sweep the longer way around the ellipse that meets these criteria. - If the
sweepFlagis true, then the ellipse will sweep clockwise around the ellipse that meets these criteria.
The method will do nothing if the destination point is the same as the current point. The method will draw a simple line segment to the destination point if either of the two radii are zero.
- Specified by:
arcToin interfacePath2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
to- the target point.radii- the X and Y radii of the tilted ellipse.xAxisRotation- the angle of tilt of the ellipse.largeArcFlag-trueiff the path will sweep the long way around the ellipse.sweepFlag-trueiff the path will sweep clockwise around the ellipse.- See Also:
- "http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands"
- The ellipse will have its X axis tilted from horizontal by the
angle
-
arcTo
default void arcTo(int tox, int toy, int radiusx, int radiusy, double xAxisRotation, boolean largeArcFlag, boolean sweepFlag)Adds a section of an shallow ellipse to the current path. The ellipse from which the portions are extracted follows the rules:- The ellipse will have its X axis tilted from horizontal by the
angle
xAxisRotationspecified in radians. - The ellipse will have the X and Y radii (viewed from its tilted
coordinate system) specified by
radiusxandradiusyunless that ellipse is too small to bridge the gap from the current point to the specified destination point in which case a larger ellipse with the same ratio of dimensions will be substituted instead. - The ellipse may slide perpendicular to the direction from the current point to the specified destination point so that it just touches the two points. The direction it slides (to the "left" or to the "right") will be chosen to meet the criteria specified by the two boolean flags as described below. Only one direction will allow the method to meet both criteria.
- If the
largeArcFlagis true, then the ellipse will sweep the longer way around the ellipse that meets these criteria. - If the
sweepFlagis true, then the ellipse will sweep clockwise around the ellipse that meets these criteria.
The method will do nothing if the destination point is the same as the current point. The method will draw a simple line segment to the destination point if either of the two radii are zero.
- Parameters:
tox- the X coordinate of the target point.toy- the Y coordinate of the target point.radiusx- the X radius of the tilted ellipse.radiusy- the Y radius of the tilted ellipse.xAxisRotation- the angle of tilt of the ellipse.largeArcFlag-trueiff the path will sweep the long way around the ellipse.sweepFlag-trueiff the path will sweep clockwise around the ellipse.- See Also:
- "http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands"
- The ellipse will have its X axis tilted from horizontal by the
angle
-
getDistanceSquared
@Pure default double getDistanceSquared(Point2D<?,?> pt)
Description copied from interface:Shape2DReplies the squared value of the minimal distance from this shape to the given point.- Specified by:
getDistanceSquaredin interfaceShape2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
pt- the point.- Returns:
- squared value of the minimal distance between this shape and the point.
-
getDistanceL1
@Pure default double getDistanceL1(Point2D<?,?> pt)
Description copied from interface:Shape2DComputes the L-1 (Manhattan) distance between this shape and point p1. The L-1 distance is equal to abs(x1-x2) + abs(y1-y2).- Specified by:
getDistanceL1in interfaceShape2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
pt- the point- Returns:
- the distance.
-
getDistanceLinf
@Pure default double getDistanceLinf(Point2D<?,?> pt)
Description copied from interface:Shape2DComputes the L-infinite distance between this shape and point p1. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2)].- Specified by:
getDistanceLinfin interfaceShape2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
pt- the point- Returns:
- the distance.
-
getLengthSquared
default double getLengthSquared()
Description copied from interface:Path2DReplies the total squared length of the path.- Specified by:
getLengthSquaredin interfacePath2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Returns:
- the length of the path.
-
getCurrentPoint
@Pure default P getCurrentPoint()
Description copied from interface:Path2DReplies the last point in the path.- Specified by:
getCurrentPointin interfacePath2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Returns:
- the last point.
-
getCurrentX
@Pure int getCurrentX()
Replies the x coordinate of the last point in the path.- Returns:
- the x coordinate of the last point in the path.
-
getCurrentY
@Pure int getCurrentY()
Replies the x coordinate of the last point in the path.- Returns:
- the x coordinate of the last point in the path.
-
getCoordAt
@Pure int getCoordAt(int index)
Replies the coordinate at the given index. The index is in [0;Path2D.size()*2).- Parameters:
index- the index.- Returns:
- the coordinate at the given index.
-
setLastPoint
void setLastPoint(int x, int y)Change the coordinates of the last inserted point.- Parameters:
x- the new x coordinate of the last point.y- the new y coordinate of the last point.
-
setLastPoint
default void setLastPoint(Point2D<?,?> point)
Description copied from interface:Path2DChange the coordinates of the last inserted point.- Specified by:
setLastPointin interfacePath2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
point- the point.
-
transform
void transform(Transform2D transform)
Transform the current path. This function changes the current path.- Parameters:
transform- is the affine transformation to apply.- See Also:
Shape2ai.createTransformedShape(org.arakhne.afc.math.geometry.d2.Transform2D)
-
remove
boolean remove(int x, int y)Remove the point with the given coordinates.If the given coordinates do not match exactly a point in the path, nothing is removed.
- Parameters:
x- the x coordinate of the point to remove.y- the y coordinate of the point to remove.- Returns:
trueif the point was removed;falseotherwise.
-
getPathIterator
@Pure default PathIterator2ai<IE> getPathIterator(double flatness)
Description copied from interface:Path2DReplies an iterator on the path elements.Only
PathElementType.MOVE_TO,PathElementType.LINE_TO, andPathElementType.CLOSEtypes are returned by the iterator.The amount of subdivision of the curved segments is controlled by the flatness parameter, which specifies the maximum distance that any point on the unflattened transformed curve can deviate from the returned flattened path segments. Note that a limit on the accuracy of the flattened path might be silently imposed, causing very small flattening parameters to be treated as larger values. This limit, if there is one, is defined by the particular implementation that is used.
The iterator for this class is not multi-threaded safe.
- Specified by:
getPathIteratorin interfacePath2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
flatness- is the maximum distance that the line segments used to approximate the curved segments are allowed to deviate from any point on the original curve.- Returns:
- an iterator on the path elements.
-
getPathIterator
@Pure default PathIterator2ai<IE> getPathIterator(Transform2D transform)
Description copied from interface:Shape2DReplies the elements of the paths.- Specified by:
getPathIteratorin interfaceShape2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Parameters:
transform- is the transformation to apply to the path.- Returns:
- the elements of the path.
-
getFlatteningPathIterator
@Pure default PathIterator2ai<IE> getFlatteningPathIterator()
Replies a path iterator on this shape that is replacing the curves by line approximations.- Returns:
- the iterator on the approximation.
- See Also:
Shape2D.getPathIterator(),GeomConstants.SPLINE_APPROXIMATION_RATIO
-
getPointIterator
@Pure default Iterator<P> getPointIterator()
Description copied from interface:Shape2aiReplies an iterator on the points covered by the perimeter of this shape.The implementation of the iterator depends on the shape type. There is no warranty about the order of the points.
- Specified by:
getPointIteratorin interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Returns:
- an iterator on the points that are located at the perimeter of the shape.
-
toCollection
@Pure default Collection<P> toCollection()
Description copied from interface:Path2DReplies the collection that is contains all the points of the path.- Specified by:
toCollectionin interfacePath2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends Path2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>- Returns:
- the point collection.
-
-