Package org.gvsig.fmap.geom.jts.gputils
Class GeneralPathXIterator
java.lang.Object
org.gvsig.fmap.geom.jts.gputils.GeneralPathXIterator
- All Implemented Interfaces:
PathIterator
- Direct Known Subclasses:
AbstractLine.LineIterator,AbstractMultiCurve.MultiCurveIterator,AbstractMultiPoint.PointIterator,AbstractMultiPolygon.MultiPolygonIterator,AbstractMultiSurface.MultiSurfaceIterator,AbstractSpline.SplineIterator,Point2D.PointIterator,Point2DM.PointIterator,Point3D.PointIterator,Point3DM.PointIterator,PointIterator
This class represents the iterator for General Paths X.
It can be used to retrieve all of the elements in a GeneralPathX.
The
method is used to create a
GeneralPathXIterator for a particular GeneralPathX.
The iterator can be used to iterator the path only once.
Subsequent iterations require a new iterator.
invalid reference
GeneralPathX#getPathIterator
- Version:
- 10 Feb 1997
- Author:
- Jim Graham
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AffineTransformprotected org.gvsig.fmap.geom.primitive.IGeneralPathXprotected intprotected intFields inherited from interface java.awt.geom.PathIterator
SEG_CLOSE, SEG_CUBICTO, SEG_LINETO, SEG_MOVETO, SEG_QUADTO, WIND_EVEN_ODD, WIND_NON_ZERO -
Constructor Summary
ConstructorsConstructorDescriptionGeneralPathXIterator(org.gvsig.fmap.geom.primitive.IGeneralPathX path) Constructs an iterator given a GeneralPathX.GeneralPathXIterator(org.gvsig.fmap.geom.primitive.IGeneralPathX path, AffineTransform at) Constructs an iterator given a GeneralPathX and an optional AffineTransform. -
Method Summary
Modifier and TypeMethodDescriptionintcurrentSegment(double[] coords) Returns the coordinates and type of the current path segment in the iteration.intcurrentSegment(float[] coords) Returns the coordinates and type of the current path segment in the iteration.intcurrentSegment3D(double[] coords) intReturn the winding rule for determining the interior of the path.booleanisDone()Tests if there are more points to read.voidnext()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
-
typeIdx
protected int typeIdx -
pointIdx
protected int pointIdx -
path
protected org.gvsig.fmap.geom.primitive.IGeneralPathX path -
affine
-
-
Constructor Details
-
GeneralPathXIterator
public GeneralPathXIterator(org.gvsig.fmap.geom.primitive.IGeneralPathX path) Constructs an iterator given a GeneralPathX.- See Also:
-
GeneralPathXIterator
Constructs an iterator given a GeneralPathX and an optional AffineTransform.- See Also:
-
-
Method Details
-
getWindingRule
public int getWindingRule()Return the winding rule for determining the interior of the path.- Specified by:
getWindingRulein interfacePathIterator- See Also:
-
isDone
public boolean isDone()Tests if there are more points to read.- Specified by:
isDonein interfacePathIterator- Returns:
- true if there are more points to read
-
next
public 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.- Specified by:
nextin interfacePathIterator
-
currentSegment
public 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 6 must be passed in and may be used to store the coordinates of the point(s). Each point is stored as a pair of float x,y coordinates. SEG_MOVETO and SEG_LINETO types will return one point, SEG_QUADTO will return two points, SEG_CUBICTO will return 3 points and SEG_CLOSE will not return any points.- Specified by:
currentSegmentin interfacePathIterator- See Also:
-
currentSegment
public 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 6 must be passed in and may be used to store the coordinates of the point(s). Each point is stored as a pair of double x,y coordinates. SEG_MOVETO and SEG_LINETO types will return one point, SEG_QUADTO will return two points, SEG_CUBICTO will return 3 points and SEG_CLOSE will not return any points.- Specified by:
currentSegmentin interfacePathIterator- See Also:
-
currentSegment3D
public int currentSegment3D(double[] coords)
-