Package snap.geom
Class ShapeBuilder
java.lang.Object
snap.geom.Shape
snap.geom.ShapeBuilder
- Direct Known Subclasses:
Path2D
This shape subclass provides basic methods for constructing a shape.
-
Field Summary
Fields inherited from class snap.geom.Shape
_bounds, WIND_EVEN_ODD, WIND_NON_ZERO
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendPathIter
(PathIter aPathIter) Appends given PathIter to this polygon path.void
appendSegment
(Segment aSegment) Appends a path segment.void
appendShape
(Shape aShape) Appends given shape to this polygon path.void
appendSvgString
(String aStr) Appends a path from an SVG path string.void
arcTo
(double cx, double cy, double endX, double endY) ArcTo: Adds a Cubic using the corner point as a guide.abstract void
close()
Closes the current polygon.abstract void
curveTo
(double cp1x, double cp1y, double cp2x, double cp2y, double endX, double endY) CubicTo.void
curveToFlat
(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y, double flatDist) CubicTo by adding lineTos.abstract double
Returns the last point X.abstract double
Returns the last point Y.void
hlineTo
(double aX) Horizontal LineTo.void
lineBy
(double aX, double aY) LineTo.abstract void
lineTo
(double aX, double aY) LineTo.abstract void
moveTo
(double aX, double aY) Moveto.abstract void
quadTo
(double cpx, double cpy, double endX, double endY) QuadTo.void
quadToFlat
(double cpx, double cpy, double x, double y, double flatDist) QuadTo by adding lineTos.void
vlineTo
(double aY) Vertical LineTo.Methods inherited from class snap.geom.Shape
addShapes, contains, contains, contains, contains, containsSeg, copyFor, copyFor, copyForBounds, crossesSeg, getArcLength, getBounds, getBoundsImpl, getCrossings, getDistance, getFlattenedShape, getFlattenedShape, getHeight, getNotSelfIntersectingShape, getPathIter, getSvgString, getWidth, getX, getY, intersectShapes, intersectsSeg, intersectsShape, intersectsShape, intersectsXY, isClosed, isFlat, isMultiCycle, isSelfIntersecting, isSingleCycle, shapeChanged, subtractShapes, toString
-
Constructor Details
-
ShapeBuilder
public ShapeBuilder()
-
-
Method Details
-
moveTo
public abstract void moveTo(double aX, double aY) Moveto. -
lineTo
public abstract void lineTo(double aX, double aY) LineTo. -
quadTo
public abstract void quadTo(double cpx, double cpy, double endX, double endY) QuadTo. -
curveTo
public abstract void curveTo(double cp1x, double cp1y, double cp2x, double cp2y, double endX, double endY) CubicTo. -
close
public abstract void close()Closes the current polygon. -
getLastPointX
public abstract double getLastPointX()Returns the last point X. -
getLastPointY
public abstract double getLastPointY()Returns the last point Y. -
arcTo
public void arcTo(double cx, double cy, double endX, double endY) ArcTo: Adds a Cubic using the corner point as a guide. -
lineBy
public void lineBy(double aX, double aY) LineTo. -
hlineTo
public void hlineTo(double aX) Horizontal LineTo. -
vlineTo
public void vlineTo(double aY) Vertical LineTo. -
appendShape
Appends given shape to this polygon path. -
appendPathIter
Appends given PathIter to this polygon path. -
appendSegment
Appends a path segment. -
appendSvgString
Appends a path from an SVG path string. -
quadToFlat
public void quadToFlat(double cpx, double cpy, double x, double y, double flatDist) QuadTo by adding lineTos. -
curveToFlat
public void curveToFlat(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y, double flatDist) CubicTo by adding lineTos.
-