Package snap.geom
Class PolygonPath
java.lang.Object
snap.geom.Shape
snap.geom.PolygonPath
This Shape subclass represents one or more polygons.
-
Field Summary
Fields inherited from class snap.geom.Shape
_bounds, WIND_EVEN_ODD, WIND_NON_ZERO
-
Constructor Summary
ConstructorDescriptionConstructor.PolygonPath
(Shape aShape) Constructor for given Shape.PolygonPath
(Shape aShape, double aFlatDistance) Constructor for given Shape. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a polygon.void
appendPathIter
(PathIter aPathIter) Appends given PathIter to this polygon path.void
appendShape
(Shape aShape) Appends given shape to this polygon path.void
close()
Closes the current polygon.void
curveTo
(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y) CubicTo by adding lineTos.protected Rect
Returns the shape bounds.double
Returns the acceptable distance of control points to segment line when flattening curved segments.Returns the last polygon last point.Returns the last polygon.getPathIter
(Transform aTransform) Returns the path iterator.getPolygon
(int anIndex) Returns the individual polygon at given index.int
Returns the number of polygons.Polygon[]
Returns the Polygons.void
lineTo
(double aX, double aY) LineTo.void
moveTo
(double aX, double aY) Moveto.void
quadTo
(double cpx, double cpy, double x, double y) QuadTo by adding lineTos.void
setFlatDistance
(double aValue) Sets the acceptable distance of control points to segment line when flattening curved segments.Methods inherited from class snap.geom.Shape
addShapes, contains, contains, contains, contains, containsSeg, copyFor, copyFor, copyForBounds, crossesSeg, getArcLength, getBounds, getCrossings, getDistance, getFlattenedShape, getFlattenedShape, getHeight, getNotSelfIntersectingShape, getSvgString, getWidth, getX, getY, intersectShapes, intersectsSeg, intersectsShape, intersectsShape, intersectsXY, isClosed, isFlat, isMultiCycle, isSelfIntersecting, isSingleCycle, shapeChanged, subtractShapes, toString
-
Field Details
-
DEFAULT_FLAT_DISTANCE
public static final double DEFAULT_FLAT_DISTANCE- See Also:
-
-
Constructor Details
-
PolygonPath
public PolygonPath()Constructor. -
PolygonPath
Constructor for given Shape. -
PolygonPath
Constructor for given Shape.
-
-
Method Details
-
getPolygons
Returns the Polygons. -
getPolygonCount
public int getPolygonCount()Returns the number of polygons. -
getPolygon
Returns the individual polygon at given index. -
addPoly
Adds a polygon. -
getLastPolygon
Returns the last polygon. -
getLastPoint
Returns the last polygon last point. -
moveTo
public void moveTo(double aX, double aY) Moveto. -
lineTo
public void lineTo(double aX, double aY) LineTo. -
close
public void close()Closes the current polygon. -
quadTo
public void quadTo(double cpx, double cpy, double x, double y) QuadTo by adding lineTos. -
curveTo
public void curveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y) CubicTo by adding lineTos. -
getFlatDistance
public double getFlatDistance()Returns the acceptable distance of control points to segment line when flattening curved segments. -
setFlatDistance
public void setFlatDistance(double aValue) Sets the acceptable distance of control points to segment line when flattening curved segments. -
appendShape
Appends given shape to this polygon path. -
appendPathIter
Appends given PathIter to this polygon path. -
getBoundsImpl
Returns the shape bounds.- Overrides:
getBoundsImpl
in classShape
-
getPathIter
Returns the path iterator.- Specified by:
getPathIter
in classShape
-