Package org.eclipse.gef.geometry.planar
Class CubicCurve
java.lang.Object
org.eclipse.gef.geometry.planar.BezierCurve
org.eclipse.gef.geometry.planar.CubicCurve
- All Implemented Interfaces:
- Serializable,- Cloneable,- ICurve,- IGeometry,- IRotatable<BezierCurve>,- IScalable<BezierCurve>,- ITranslatable<BezierCurve>
An instance of the 
CubicCurve class represents a BezierCurve
 of degree 3, having a start and an end Point and two handle
 Points.- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionCubicCurve(double... coordinates) Constructs a newCubicCurveobject with the given sequence of x and y coordinates of the startPoint, the two handlePoints, and the endPoint.CubicCurve(double x1, double y1, double ctrl1X, double ctrl1Y, double ctrl2X, double ctrl2Y, double x2, double y2) Constructs a newCubicCurveobject from the given controlPointcoordinates.CubicCurve(Point... points) Constructs a newCubicCurvefrom the given sequence ofPoints, which is expected to be in the order: startPoint, first and second handlePoints, and endPoint.CubicCurve(Point start, Point ctrl1, Point ctrl2, Point end) Constructs a newCubicCurveobject from the given controlPoints.
- 
Method SummaryModifier and TypeMethodDescriptionclone()Overridden with public visibility as recommended withinCloneable.getCopy()Returns a newCubicCurve, which has the same controlPoints as this one.getCtrl1()Returns the first handlePoint.getCtrl2()Returns the second handlePoint.doubleReturns the first handlePoint's x coordinate.doubleReturns the second handlePoint's x coordinate.doubleReturns the first handlePoint's y coordinate.doubleReturns the second handlePoint's y coordinate.final inthashCode()setCtrl1X(double ctrl1x) Sets the x coordinate of the first handlePointof thisCubicCurveto the given value.setCtrl1Y(double ctrl1y) Sets the y coordinate of the first handlePointof thisCubicCurveto the given value.setCtrl2X(double ctrl2x) Sets the x coordinate of the second handlePointof thisCubicCurveto the given value.setCtrl2Y(double ctrl2y) Sets the y coordinate of the second handlePointof thisCubicCurveto the given value.split(double t) Subdivides thisBezierCurveat the given parameter value t into two newBezierCurves.toPath()toString()booleanMethods inherited from class org.eclipse.gef.geometry.planar.BezierCurvecontains, 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
- 
Constructor Details- 
CubicCurvepublic CubicCurve(double... coordinates) Constructs a newCubicCurveobject with the given sequence of x and y coordinates of the startPoint, the two handlePoints, and the endPoint.- Parameters:
- coordinates- the sequence of x and y coordinates specifying this- CubicCurve's control- Points
- See Also:
 
- 
CubicCurvepublic CubicCurve(double x1, double y1, double ctrl1X, double ctrl1Y, double ctrl2X, double ctrl2Y, double x2, double y2) Constructs a newCubicCurveobject from the given controlPointcoordinates.- Parameters:
- 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
 
- 
CubicCurveConstructs a newCubicCurvefrom the given sequence ofPoints, which is expected to be in the order: startPoint, first and second handlePoints, and endPoint.- Parameters:
- points- the sequence of- Points from which this- CubicCurveis constructed
- See Also:
 
- 
CubicCurveConstructs a newCubicCurveobject from the given controlPoints.
 
- 
- 
Method Details- 
getCopyReturns a newCubicCurve, which has the same controlPoints as this one.- Specified by:
- getCopyin interface- IGeometry
- Overrides:
- getCopyin class- BezierCurve
- Returns:
- a new CubicCurvewith the same controlPoints as this one
 
- 
getCtrl1Returns the first handlePoint.- Returns:
- the first handle Point
 
- 
getCtrl2Returns the second handlePoint.- Returns:
- the second handle Point
 
- 
getCtrlX1public double getCtrlX1()Returns the first handlePoint's x coordinate.- Returns:
- the first handle Point's x coordinate
 
- 
getCtrlX2public double getCtrlX2()Returns the second handlePoint's x coordinate.- Returns:
- the second handle Point's x coordinate
 
- 
getCtrlY1public double getCtrlY1()Returns the first handlePoint's y coordinate.- Returns:
- the first handle Point's y coordinate
 
- 
getCtrlY2public double getCtrlY2()Returns the second handlePoint's y coordinate.- Returns:
- the second handle Point's y coordinate
 
- 
getTransformedDefault implementation returning a transformedPathrepresentation of thisIGeometry. Subclasses may override this method to return a more specific representation.- Specified by:
- getTransformedin interface- IGeometry
- Overrides:
- getTransformedin class- BezierCurve
- Parameters:
- t- The- AffineTransformto be applied
- Returns:
- a transformed Pathrepresentation of thisIGeometry
- See Also:
 
- 
setCtrl1- Parameters:
- ctrl1- the new first handle- Point
- Returns:
- thisfor convenience
 
- 
setCtrl1XSets the x coordinate of the first handlePointof thisCubicCurveto the given value.- Parameters:
- ctrl1x- the new x coordinate of the first handle- Pointof this- CubicCurve
- Returns:
- thisfor convenience
 
- 
setCtrl1YSets the y coordinate of the first handlePointof thisCubicCurveto the given value.- Parameters:
- ctrl1y- the new y coordinate of the first handle- Pointof this- CubicCurve
- Returns:
- thisfor convenience
 
- 
setCtrl2- Parameters:
- ctrl2- the new second handle- Pointof this- CubicCurve
- Returns:
- thisfor convenience
 
- 
setCtrl2XSets the x coordinate of the second handlePointof thisCubicCurveto the given value.- Parameters:
- ctrl2x- the new x coordinate of the second handle- Pointof this- CubicCurve
- Returns:
- thisfor convenience
 
- 
setCtrl2YSets the y coordinate of the second handlePointof thisCubicCurveto the given value.- Parameters:
- ctrl2y- the new y coordinate of the second handle- Pointof this- CubicCurve
- Returns:
- thisfor convenience
 
- 
setCurve
- 
splitDescription copied from class:BezierCurveSubdivides thisBezierCurveat the given parameter value t into two newBezierCurves. The first one is theBezierCurveover the parameterBezierCurve.Interval[0;t]and the second one is theBezierCurveover the parameterBezierCurve.Interval[t;1].- Overrides:
- splitin class- BezierCurve
- Parameters:
- t- the parameter value at which this- BezierCurveis subdivided
- Returns:
- an array of two BezierCurves, the left ([0;t]) and the right ([t;1])
 
- 
toPathDescription copied from class:BezierCurve- Specified by:
- toPathin interface- IGeometry
- Overrides:
- toPathin class- BezierCurve
- Returns:
- a Pathapproximating thisBezierCurveusingLinesegments
 
- 
toString- Overrides:
- toStringin class- BezierCurve
 
- 
cloneOverridden with public visibility as recommended withinCloneable.
- 
hashCodepublic final int hashCode()
- 
touchesDescription copied from interface:IGeometry
 
-