|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.geom.CubicCurve2D
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.
Inner Class Summary | |
static | CubicCurve2D.Double
A cubic parametric curve segment specified with double coordinates. |
static | CubicCurve2D.Float
A cubic parametric curve segment specified with float coordinates. |
Constructor Summary | |
CubicCurve2D()
This is an abstract class that cannot be instantiated directly. |
Method Summary | |
Object | clone()
Creates a new object of the same class as this object. |
boolean | contains(double x,
double y,
double w,
double h)
Test if the interior of the Shape entirely contains the given set of rectangular coordinates. |
boolean | contains(double x,
double y)
Test if a given coordinate is inside the boundary of the shape. |
boolean | contains(Point2D p)
Test if a given Point is inside the boundary of the shape. |
boolean | contains(Rectangle2D r)
Test if the interior of the Shape entirely contains the given Rectangle. |
Rectangle | getBounds()
Return the bounding box of the shape. |
abstract Point2D | getCtrlP1()
Returns the first control point. |
abstract Point2D | getCtrlP2()
Returns the second control point. |
abstract double | getCtrlX1()
Returns the X coordinate of the first control point in double precision. |
abstract double | getCtrlX2()
Returns the X coordinate of the second control point in double precision. |
abstract double | getCtrlY1()
Returns the Y coordinate of the first control point in double precision. |
abstract double | getCtrlY2()
Returns the Y coordinate of the second control point in double precision. |
double | getFlatness()
Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of this curve. |
static double | getFlatness(double x1,
double y1,
double ctrlx1,
double ctrly1,
double ctrlx2,
double ctrly2,
double x2,
double y2)
Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the cubic curve specified by the indicated controlpoints. |
static double | getFlatness(double[] coords,
int offset)
Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the cubic curve specified by the controlpoints stored in the indicated array at the indicated index. |
double | getFlatnessSq()
Returns the square of the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of this curve. |
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, or maximum distance of a controlpoint from the line connecting the endpoints, of the cubic curve specified by the indicated controlpoints. |
static double | getFlatnessSq(double[] coords,
int offset)
Returns the square of the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the cubic curve specified by the controlpoints stored in the indicated array at the indicated index. |
abstract Point2D | getP1()
Returns the start point. |
abstract Point2D | getP2()
Returns the end point. |
PathIterator | getPathIterator(AffineTransform at,
double flatness)
Return an iteration object that defines the boundary of the flattened shape. |
PathIterator | getPathIterator(AffineTransform at)
Return an iteration object that defines the boundary of the shape. |
abstract double | getX1()
Returns the X coordinate of the start point in double precision. |
abstract double | getX2()
Returns the X coordinate of the end point in double precision. |
abstract double | getY1()
Returns the Y coordinate of the start point in double precision. |
abstract double | getY2()
Returns the Y coordinate of the end point in double precision. |
boolean | intersects(double x,
double y,
double w,
double h)
Test if the Shape intersects the interior of a given set of rectangular coordinates. |
boolean | intersects(Rectangle2D r)
Test if the Shape intersects the interior of a given Rectangle. |
void | setCurve(CubicCurve2D c)
Sets the location of the endpoints and controlpoints of this curve to the same as those in the specified CubicCurve. |
abstract void | setCurve(double x1,
double y1,
double ctrlx1,
double ctrly1,
double ctrlx2,
double ctrly2,
double x2,
double y2)
Sets the location of the endpoints and controlpoints of this curve to the specified double coordinates. |
void | setCurve(double[] coords,
int offset)
Sets the location of the endpoints and controlpoints of this curve to the double coordinates at the specified offset in the specified array. |
void | setCurve(Point2D p1,
Point2D cp1,
Point2D cp2,
Point2D p2)
Sets the location of the endpoints and controlpoints of this curve to the specified Point coordinates. |
void | setCurve(Point2D[] pts,
int offset)
Sets the location of the endpoints and controlpoints of this curve to the coordinates of the Point objects at the specified offset in the specified array. |
static int | solveCubic(double[] eqn)
Solve the cubic whose coefficients are in the eqn array and place the non-complex roots back into the array, returning the number of roots. |
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. |
void | subdivide(CubicCurve2D left,
CubicCurve2D right)
Subdivides this cubic curve and stores the resulting two subdivided curves into the left and right curve parameters. |
static void | subdivide(double[] src,
int srcoff,
double[] left,
int leftoff,
double[] right,
int rightoff)
Subdivides the cubic curve specified by the 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. |
Methods inherited from class java.lang.Object | |
equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
Constructor Detail |
protected CubicCurve2D()
CubicCurve2D.Float
,
CubicCurve2D.Double
Method Detail |
public abstract double getX1()
public abstract double getY1()
public abstract Point2D getP1()
public abstract double getCtrlX1()
public abstract double getCtrlY1()
public abstract Point2D getCtrlP1()
public abstract double getCtrlX2()
public abstract double getCtrlY2()
public abstract Point2D getCtrlP2()
public abstract double getX2()
public abstract double getY2()
public abstract Point2D getP2()
public abstract void setCurve(double x1, double y1, double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)
public void setCurve(double[] coords, int offset)
public void setCurve(Point2D p1, Point2D cp1, Point2D cp2, Point2D p2)
public void setCurve(Point2D[] pts, int offset)
public void setCurve(CubicCurve2D c)
public static double getFlatnessSq(double x1, double y1, double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)
public static double getFlatness(double x1, double y1, double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)
public static double getFlatnessSq(double[] coords, int offset)
public static double getFlatness(double[] coords, int offset)
public double getFlatnessSq()
public double getFlatness()
public void subdivide(CubicCurve2D left, CubicCurve2D right)
left
- the cubic curve object for storing for the left or
first half of the subdivided curve
right
- the cubic curve object for storing for the right or
second half of the subdivided curvepublic static void subdivide(CubicCurve2D src, CubicCurve2D left, CubicCurve2D right)
src
- the cubic curve to be subdivided
left
- the cubic curve object for storing for the left or
first half of the subdivided curve
right
- the cubic curve object for storing for the right or
second half of the subdivided curvepublic static void subdivide(double[] src, int srcoff, double[] left, int leftoff, double[] right, int rightoff)
src
- the array holding the coordinates for the source curve
srcoff
- the offset into the array of the beginning of the
the 6 source coordinates
left
- the array for storing the coordinates for the first
half of the subdivided curve
leftoff
- the offset into the array of the beginning of the
the 6 left coordinates
right
- the array for storing the coordinates for the second
half of the subdivided curve
rightoff
- the offset into the array of the beginning of the
the 6 right coordinatespublic static int solveCubic(double[] eqn)
public boolean contains(double x, double y)
public boolean contains(Point2D p)
public boolean intersects(double x, double y, double w, double h)
public boolean intersects(Rectangle2D r)
public boolean contains(double x, double y, double w, double h)
public boolean contains(Rectangle2D r)
public Rectangle getBounds()
public PathIterator getPathIterator(AffineTransform at)
public PathIterator getPathIterator(AffineTransform at, double flatness)
public Object clone()
Cloneable
|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |