public class CubicCurve extends BezierCurve
CubicCurve class represents a BezierCurve
of degree 3, having a start and an end Point and two handle
Points.| Constructor and Description |
|---|
CubicCurve(double... coordinates)
Constructs a new
CubicCurve object with the given sequence of x
and y coordinates of the start Point, the two handle
Points, and the end Point. |
CubicCurve(double x1,
double y1,
double ctrl1X,
double ctrl1Y,
double ctrl2X,
double ctrl2Y,
double x2,
double y2)
Constructs a new
CubicCurve object from the given control
Point coordinates. |
CubicCurve(Point... points)
Constructs a new
CubicCurve from the given sequence of
Points, which is expected to be in the order: start Point
, first and second handle Points, and end Point. |
CubicCurve(Point start,
Point ctrl1,
Point ctrl2,
Point end)
Constructs a new
CubicCurve object from the given control
Points. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Overridden with public visibility as recommended within
Cloneable
. |
CubicCurve |
getCopy()
Returns a new
CubicCurve, which has the same control
Points as this one. |
Point |
getCtrl1()
Returns the first handle
Point. |
Point |
getCtrl2()
Returns the second handle
Point. |
double |
getCtrlX1()
Returns the first handle
Point's x coordinate. |
double |
getCtrlX2()
Returns the second handle
Point's x coordinate. |
double |
getCtrlY1()
Returns the first handle
Point's y coordinate. |
double |
getCtrlY2()
Returns the second handle
Point's y coordinate. |
CubicCurve |
getTransformed(AffineTransform t)
|
int |
hashCode() |
CubicCurve |
setCtrl1(Point ctrl1)
|
CubicCurve |
setCtrl1X(double ctrl1x)
Sets the x coordinate of the first handle
Point of this
CubicCurve to the given value. |
CubicCurve |
setCtrl1Y(double ctrl1y)
Sets the y coordinate of the first handle
Point of this
CubicCurve to the given value. |
CubicCurve |
setCtrl2(Point ctrl2)
|
CubicCurve |
setCtrl2X(double ctrl2x)
Sets the x coordinate of the second handle
Point of this
CubicCurve to the given value. |
CubicCurve |
setCtrl2Y(double ctrl2y)
Sets the y coordinate of the second handle
Point of this
CubicCurve to the given value. |
CubicCurve |
setCurve(Point p1,
Point ctrl1,
Point ctrl2,
Point p2)
|
CubicCurve[] |
split(double t)
Subdivides this
BezierCurve at the given parameter value t
into two new BezierCurves. |
Path |
toPath()
|
java.lang.String |
toString() |
boolean |
touches(IGeometry g)
|
contains, contains, equals, get, getBounds, getClipped, getControlBounds, getDerivative, getElevated, getIntersectionIntervalPairs, getIntersections, getIntersections, getOverlap, getOverlaps, getP1, getP2, getParameterAt, getPoint, getPoints, getProjection, getRotatedCCW, getRotatedCCW, getRotatedCCW, getRotatedCW, getRotatedCW, getRotatedCW, getScaled, getScaled, getScaled, getScaled, getScaled, getScaled, getTranslated, getTranslated, getX1, getX2, getY1, getY2, intersects, overlaps, overlaps, rotateCCW, rotateCCW, rotateCCW, rotateCW, rotateCW, rotateCW, scale, scale, scale, scale, scale, scale, setP1, setP2, setPoint, toBezier, toCubic, toLine, toLineStrip, toLineStrip, toPoints, toQuadratic, translate, translatepublic CubicCurve(double... coordinates)
CubicCurve object with the given sequence of x
and y coordinates of the start Point, the two handle
Points, and the end Point.coordinates - the sequence of x and y coordinates specifying this
CubicCurve's control PointsCubicCurve(double, double, double, double, double,
double, double, double)public CubicCurve(double x1,
double y1,
double ctrl1X,
double ctrl1Y,
double ctrl2X,
double ctrl2Y,
double x2,
double y2)
CubicCurve object from the given control
Point coordinates.x1 - the x coordinate of the start Pointy1 - the y coordinate of the start Pointctrl1X - the x coordinate of the first handle Pointctrl1Y - the y coordinate of the first handle Pointctrl2X - the x coordinate of the second handle Pointctrl2Y - the y coordinate of the second handle Pointx2 - the x coordinate of the end Pointy2 - the y coordinate of the end Pointpublic CubicCurve(Point... points)
CubicCurve from the given sequence of
Points, which is expected to be in the order: start Point
, first and second handle Points, and end Point.points - the sequence of Points from which this
CubicCurve is constructedCubicCurve(Point, Point, Point, Point),
CubicCurve(double, double, double, double, double,
double, double, double)public CubicCurve(Point start, Point ctrl1, Point ctrl2, Point end)
CubicCurve object from the given control
Points.start - the start Pointctrl1 - the first handle Pointctrl2 - the second handle Pointend - the end PointCubicCurve(double, double, double, double, double,
double, double, double)public CubicCurve getCopy()
CubicCurve, which has the same control
Points as this one.getCopy in interface IGeometrygetCopy in class BezierCurveCubicCurve with the same control Points as
this onepublic double getCtrlX1()
Point's x coordinate.Point's x coordinatepublic double getCtrlX2()
Point's x coordinate.Point's x coordinatepublic double getCtrlY1()
Point's y coordinate.Point's y coordinatepublic double getCtrlY2()
Point's y coordinate.Point's y coordinatepublic CubicCurve getTransformed(AffineTransform t)
Path
representation of this IGeometry. Subclasses may override this
method to return a more specific representation.getTransformed in interface IGeometrygetTransformed in class BezierCurvet - The AffineTransform to be appliedPath representation of this
IGeometryIGeometry.getTransformed(AffineTransform)public CubicCurve setCtrl1(Point ctrl1)
ctrl1 - the new first handle Pointthis for conveniencepublic CubicCurve setCtrl1X(double ctrl1x)
Point of this
CubicCurve to the given value.ctrl1x - the new x coordinate of the first handle Point of this
CubicCurvethis for conveniencepublic CubicCurve setCtrl1Y(double ctrl1y)
Point of this
CubicCurve to the given value.ctrl1y - the new y coordinate of the first handle Point of this
CubicCurvethis for conveniencepublic CubicCurve setCtrl2(Point ctrl2)
ctrl2 - the new second handle Point of this CubicCurvethis for conveniencepublic CubicCurve setCtrl2X(double ctrl2x)
Point of this
CubicCurve to the given value.ctrl2x - the new x coordinate of the second handle Point of
this CubicCurvethis for conveniencepublic CubicCurve setCtrl2Y(double ctrl2y)
Point of this
CubicCurve to the given value.ctrl2y - the new y coordinate of the second handle Point of
this CubicCurvethis for conveniencepublic CubicCurve setCurve(Point p1, Point ctrl1, Point ctrl2, Point p2)
public CubicCurve[] split(double t)
BezierCurveBezierCurve at the given parameter value t
into two new BezierCurves. The first one is the
BezierCurve over the parameter Interval
[0;t] and the second one is the BezierCurve over the
parameter Interval [t;1].split in class BezierCurvet - the parameter value at which this BezierCurve is
subdividedBezierCurves, the left (
[0;t]) and the right ([t;1])public Path toPath()
BezierCurvetoPath in interface IGeometrytoPath in class BezierCurvePath approximating this BezierCurve using
Line segmentspublic java.lang.String toString()
toString in class BezierCurvepublic java.lang.Object clone()
Cloneable
.clone in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()Copyright (c) 2014 itemis AG, and others. All rights reserved.