public class CubicCurve extends BezierCurve
CubicCurve
class represents a BezierCurve
of degree 3, having a start and an end Point
and two handle
Point
s.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
Point s, 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
Point s, which is expected to be in the order: start Point
, first and second handle Point s, and end Point . |
CubicCurve(Point start,
Point ctrl1,
Point ctrl2,
Point end)
Constructs a new
CubicCurve object from the given control
Point s. |
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
Point s 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 BezierCurve s. |
Path |
toPath()
|
java.lang.String |
toString() |
boolean |
touches(IGeometry g)
|
contains, contains, equals, get, getBounds, getClipped, getControlBounds, getDerivative, getElevated, getIntersections, getIntersections, getOffset, 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, translate
public CubicCurve(double... coordinates)
CubicCurve
object with the given sequence of x
and y coordinates of the start Point
, the two handle
Point
s, and the end Point
.coordinates
- the sequence of x and y coordinates specifying this
CubicCurve
's control Point
sCubicCurve(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 Point
y1
- the y coordinate of the start Point
ctrl1X
- the x coordinate of the first handle Point
ctrl1Y
- the y coordinate of the first handle Point
ctrl2X
- the x coordinate of the second handle Point
ctrl2Y
- the y coordinate of the second handle Point
x2
- the x coordinate of the end Point
y2
- the y coordinate of the end Point
public CubicCurve(Point... points)
CubicCurve
from the given sequence of
Point
s, which is expected to be in the order: start Point
, first and second handle Point
s, and end Point
.points
- the sequence of Point
s 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
Point
s.start
- the start Point
ctrl1
- the first handle Point
ctrl2
- the second handle Point
end
- the end Point
CubicCurve(double, double, double, double, double,
double, double, double)
public CubicCurve getCopy()
CubicCurve
, which has the same control
Point
s as this one.getCopy
in interface IGeometry
getCopy
in class BezierCurve
CubicCurve
with the same control Point
s 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 IGeometry
getTransformed
in class BezierCurve
t
- The AffineTransform
to be appliedPath
representation of this
IGeometry
IGeometry.getTransformed(AffineTransform)
public CubicCurve setCtrl1(Point ctrl1)
ctrl1
- the new first handle Point
this
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
CubicCurve
this
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
CubicCurve
this
for conveniencepublic CubicCurve setCtrl2(Point ctrl2)
ctrl2
- the new second handle Point
of this CubicCurve
this
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 CubicCurve
this
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 CubicCurve
this
for conveniencepublic CubicCurve setCurve(Point p1, Point ctrl1, Point ctrl2, Point p2)
public CubicCurve[] split(double t)
BezierCurve
BezierCurve
at the given parameter value t
into two new BezierCurve
s. 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 BezierCurve
t
- the parameter value at which this BezierCurve
is
subdividedBezierCurve
s, the left (
[0;t]
) and the right ([t;1]
)public Path toPath()
BezierCurve
toPath
in interface IGeometry
toPath
in class BezierCurve
Path
approximating this BezierCurve
using
Line
segmentspublic java.lang.String toString()
toString
in class BezierCurve
public java.lang.Object clone()
Cloneable
.clone
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
Copyright (c) 2014 itemis AG, and others. All rights reserved.