Save This Page
Home » openjdk-7 » java » awt » geom » [javadoc | source]
java.awt.geom
abstract public class: CubicCurve2D [javadoc | source]
java.lang.Object
   java.awt.geom.CubicCurve2D

All Implemented Interfaces:
    Shape, Cloneable

Direct Known Subclasses:
    Float, Double

The CubicCurve2D class defines a cubic parametric curve segment in {@code (x,y)} coordinate space.

This class is only the abstract superclass for all objects which store a 2D cubic curve segment. The actual storage representation of the coordinates is left to the subclass.

Nested Class Summary:
public static class  CubicCurve2D.Float  A cubic parametric curve segment specified with {@code float} coordinates. 
public static class  CubicCurve2D.Double  A cubic parametric curve segment specified with {@code double} coordinates. 
Constructor:
 protected CubicCurve2D() 
Method from java.awt.geom.CubicCurve2D Summary:
clone,   contains,   contains,   contains,   contains,   getBounds,   getCtrlP1,   getCtrlP2,   getCtrlX1,   getCtrlX2,   getCtrlY1,   getCtrlY2,   getFlatness,   getFlatness,   getFlatness,   getFlatnessSq,   getFlatnessSq,   getFlatnessSq,   getP1,   getP2,   getPathIterator,   getPathIterator,   getX1,   getX2,   getY1,   getY2,   intersects,   intersects,   setCurve,   setCurve,   setCurve,   setCurve,   setCurve,   solveCubic,   solveCubic,   subdivide,   subdivide,   subdivide
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.awt.geom.CubicCurve2D Detail:
 public Object clone() 
    Creates a new object of the same class as this object.
 public boolean contains(Point2D p) 
    {@inheritDoc}
 public boolean contains(Rectangle2D r) 
    {@inheritDoc}
 public boolean contains(double x,
    double y) 
    {@inheritDoc}
 public boolean contains(double x,
    double y,
    double w,
    double h) 
    {@inheritDoc}
 public Rectangle getBounds() 
    {@inheritDoc}
 abstract public Point2D getCtrlP1()
    Returns the first control point.
 abstract public Point2D getCtrlP2()
    Returns the second control point.
 abstract public double getCtrlX1()
    Returns the X coordinate of the first control point in double precision.
 abstract public double getCtrlX2()
    Returns the X coordinate of the second control point in double precision.
 abstract public double getCtrlY1()
    Returns the Y coordinate of the first control point in double precision.
 abstract public double getCtrlY2()
    Returns the Y coordinate of the second control point in double precision.
 public double getFlatness() 
    Returns the flatness of this curve. The flatness is the maximum distance of a control point from the line connecting the end points.
 public static double getFlatness(double[] coords,
    int offset) 
    Returns the flatness of the cubic curve specified by the control points stored in the indicated array at the indicated index. The flatness is the maximum distance of a control point from the line connecting the end points.
 public static double getFlatness(double x1,
    double y1,
    double ctrlx1,
    double ctrly1,
    double ctrlx2,
    double ctrly2,
    double x2,
    double y2) 
    Returns the flatness of the cubic curve specified by the indicated control points. The flatness is the maximum distance of a control point from the line connecting the end points.
 public double getFlatnessSq() 
    Returns the square of the flatness of this curve. The flatness is the maximum distance of a control point from the line connecting the end points.
 public static double getFlatnessSq(double[] coords,
    int offset) 
    Returns the square of the flatness of the cubic curve specified by the control points stored in the indicated array at the indicated index. The flatness is the maximum distance of a control point from the line connecting the end points.
 public static double getFlatnessSq(double x1,
    double y1,
    double ctrlx1,
    double ctrly1,
    double ctrlx2,
    double ctrly2,
    double x2,
    double y2) 
    Returns the square of the flatness of the cubic curve specified by the indicated control points. The flatness is the maximum distance of a control point from the line connecting the end points.
 abstract public Point2D getP1()
    Returns the start point.
 abstract public Point2D getP2()
    Returns the end point.
 public PathIterator getPathIterator(AffineTransform at) 
    Returns an iteration object that defines the boundary of the shape. The iterator for this class is not multi-threaded safe, which means that this CubicCurve2D class does not guarantee that modifications to the geometry of this CubicCurve2D object do not affect any iterations of that geometry that are already in process.
 public PathIterator getPathIterator(AffineTransform at,
    double flatness) 
    Return an iteration object that defines the boundary of the flattened shape. The iterator for this class is not multi-threaded safe, which means that this CubicCurve2D class does not guarantee that modifications to the geometry of this CubicCurve2D object do not affect any iterations of that geometry that are already in process.
 abstract public double getX1()
    Returns the X coordinate of the start point in double precision.
 abstract public double getX2()
    Returns the X coordinate of the end point in double precision.
 abstract public double getY1()
    Returns the Y coordinate of the start point in double precision.
 abstract public double getY2()
    Returns the Y coordinate of the end point in double precision.
 public boolean intersects(Rectangle2D r) 
    {@inheritDoc}
 public boolean intersects(double x,
    double y,
    double w,
    double h) 
    {@inheritDoc}
 public  void setCurve(CubicCurve2D c) 
    Sets the location of the end points and control points of this curve to the same as those in the specified CubicCurve2D.
 public  void setCurve(double[] coords,
    int offset) 
    Sets the location of the end points and control points of this curve to the double coordinates at the specified offset in the specified array.
 public  void setCurve(Point2D[] pts,
    int offset) 
    Sets the location of the end points and control points of this curve to the coordinates of the Point2D objects at the specified offset in the specified array.
 public  void setCurve(Point2D p1,
    Point2D cp1,
    Point2D cp2,
    Point2D p2) 
    Sets the location of the end points and control points of this curve to the specified Point2D coordinates.
 abstract public  void setCurve(double x1,
    double y1,
    double ctrlx1,
    double ctrly1,
    double ctrlx2,
    double ctrly2,
    double x2,
    double y2)
    Sets the location of the end points and control points of this curve to the specified double coordinates.
 public static int solveCubic(double[] eqn) 
    Solves the cubic whose coefficients are in the eqn array and places the non-complex roots back into the same array, returning the number of roots. The solved cubic is represented by the equation:
    eqn = {c, b, a, d}
    dx^3 + ax^2 + bx + c = 0
    
    A return value of -1 is used to distinguish a constant equation that might be always 0 or never 0 from an equation that has no zeroes.
 public static int solveCubic(double[] eqn,
    double[] res) 
    Solve the cubic whose coefficients are in the eqn array and place the non-complex roots into the res array, returning the number of roots. The cubic solved is represented by the equation: eqn = {c, b, a, d} dx^3 + ax^2 + bx + c = 0 A return value of -1 is used to distinguish a constant equation, which may be always 0 or never 0, from an equation which has no zeroes.
 public  void subdivide(CubicCurve2D left,
    CubicCurve2D right) 
    Subdivides this cubic curve and stores the resulting two subdivided curves into the left and right curve parameters. Either or both of the left and right objects may be the same as this object or null.
 public static  void subdivide(CubicCurve2D src,
    CubicCurve2D left,
    CubicCurve2D right) 
    Subdivides the cubic curve specified by the src parameter and stores the resulting two subdivided curves into the left and right curve parameters. Either or both of the left and right objects may be the same as the src object or null.
 public static  void subdivide(double[] src,
    int srcoff,
    double[] left,
    int leftoff,
    double[] right,
    int rightoff) 
    Subdivides the cubic curve specified by the coordinates stored in the src array at indices srcoff through (srcoff + 7) and stores the resulting two subdivided curves into the two result arrays at the corresponding indices. Either or both of the left and right arrays may be null or a reference to the same array as the src array. Note that the last point in the first subdivided curve is the same as the first point in the second subdivided curve. Thus, it is possible to pass the same array for left and right and to use offsets, such as rightoff equals (leftoff + 6), in order to avoid allocating extra storage for this common point.