- All Known Implementing Classes:
ConditionalPathIterator3D
,FlatteningPathIterator3D
,TransformedPathIterator3D
public interface PathIterator3D
The PathIterator3D interface provides the ability to iterate
over a path in three dimensions.
The API is modeled after PathIterator
and
much of the text was copied from the API documentation for that
class, with slight modifications. The reason to make the interface
similar to PathIterator
is that programmers
are familiar with that API. Constants with the same name in both
APIs have the same value.
PathIterator3D
is not an extension of
PathIterator
because PathIterator3D
eliminates a method instead of adding one.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The segment type constant that specifies that the preceding subpath should be closed by appending a line segment back to the point corresponding to the most recent SEG_MOVETO.static final int
The segment type constant for the set of 3 points that specify a cubic parametric curve to be drawn from the most recently specified point.static final int
The segment type constant for a point that specifies the end point of a line to be drawn from the most recently specified point.static final int
The segment type constant for a point that specifies the starting location for a new subpath.static final int
The segment type constant for the pair of points that specify a quadratic parametric curve to be drawn from the most recently specified point. -
Method Summary
Modifier and TypeMethodDescriptionint
currentSegment
(double[] coords) Returns the coordinates and type of the current path segment in the iteration.int
currentSegment
(float[] coords) Returns the coordinates and type of the current path segment in the iteration.boolean
isDone()
Tests if the iteration is complete.void
next()
Moves the iterator to the next segment of the path forwards along the primary direction of traversal as long as there are more points in that direction.
-
Field Details
-
SEG_CLOSE
static final int SEG_CLOSEThe segment type constant that specifies that the preceding subpath should be closed by appending a line segment back to the point corresponding to the most recent SEG_MOVETO.- See Also:
-
SEG_CUBICTO
static final int SEG_CUBICTOThe segment type constant for the set of 3 points that specify a cubic parametric curve to be drawn from the most recently specified point.- See Also:
-
SEG_LINETO
static final int SEG_LINETOThe segment type constant for a point that specifies the end point of a line to be drawn from the most recently specified point.- See Also:
-
SEG_MOVETO
static final int SEG_MOVETOThe segment type constant for a point that specifies the starting location for a new subpath.- See Also:
-
SEG_QUADTO
static final int SEG_QUADTOThe segment type constant for the pair of points that specify a quadratic parametric curve to be drawn from the most recently specified point.- See Also:
-
-
Method Details
-
currentSegment
int currentSegment(double[] coords) Returns the coordinates and type of the current path segment in the iteration. The return value is the path-segment type: SEG_MOVETO, SEG_LINETO, SEG_QUADTO, SEG_CUBICTO, or SEG_CLOSE. A double array of length 9 must be passed in and can be used to store the coordinates of the point(s). Each point is stored as a triplet of double x,y,z coordinates. SEG_MOVETO and SEG_LINETO types returns one point, SEG_QUADTO returns two points, SEG_CUBICTO returns 3 points and SEG_CLOSE does not return any points.- Parameters:
coords
- - an array that holds the data returned from this method- Returns:
- he path-segment type of the current path segment
-
currentSegment
int currentSegment(float[] coords) Returns the coordinates and type of the current path segment in the iteration. The return value is the path-segment type: SEG_MOVETO, SEG_LINETO, SEG_QUADTO, SEG_CUBICTO, or SEG_CLOSE. A float array of length 9 must be passed in and can be used to store the coordinates of the point(s). Each point is stored as a triplet of float x,y,z coordinates. SEG_MOVETO and SEG_LINETO types returns one point, SEG_QUADTO returns two points, SEG_CUBICTO returns 3 points and SEG_CLOSE does not return any points.- Parameters:
coords
- - an array that holds the data returned from this method- Returns:
- the path-segment type of the current path segment.
-
isDone
boolean isDone()Tests if the iteration is complete.- Returns:
- true if all the segments have been read; false otherwise.
-
next
void next()Moves the iterator to the next segment of the path forwards along the primary direction of traversal as long as there are more points in that direction.
-