public abstract class AbstractCubicCurve extends Object implements ICubicCurve
ICubicCurve
, obtaining only the start, end and
control points from the derived class.Constructor and Description |
---|
AbstractCubicCurve() |
Modifier and Type | Method and Description |
---|---|
Rectangle |
bounds()
Returns a copy of the bounding rectangle for this shape.
|
Rectangle |
bounds(Rectangle target)
Initializes the supplied rectangle with this shape's bounding rectangle.
|
CubicCurve |
clone()
Returns a mutable copy of this curve.
|
boolean |
contains(double px,
double py)
Returns true if this shape contains the specified point.
|
boolean |
contains(double rx,
double ry,
double rw,
double rh)
Returns true if this shape completely contains the specified rectangle.
|
boolean |
contains(IRectangle r)
Returns true if this shape completely contains the supplied rectangle.
|
boolean |
contains(XY p)
Returns true if this shape contains the supplied point.
|
Point |
ctrlP1()
Returns a copy of the first control point of this curve.
|
Point |
ctrlP2()
Returns a copy of the second control point of this curve.
|
double |
flatness()
Returns the flatness (maximum distance of a control point from the line connecting the end
points) of this curve.
|
double |
flatnessSq()
Returns the square of the flatness (maximum distance of a control point from the line
connecting the end points) of this curve.
|
boolean |
intersects(double rx,
double ry,
double rw,
double rh)
Returns true if this shape intersects the specified rectangle.
|
boolean |
intersects(IRectangle r)
Returns true if this shape intersects the supplied rectangle.
|
boolean |
isEmpty()
Returns true if this shape encloses no area.
|
Point |
p1()
Returns a copy of the starting point of this curve.
|
Point |
p2()
Returns a copy of the ending point of this curve.
|
PathIterator |
pathIterator(Transform t)
Returns an iterator over the path described by this shape.
|
PathIterator |
pathIterator(Transform at,
double flatness)
Returns an iterator over the path described by this shape.
|
void |
subdivide(CubicCurve left,
CubicCurve right)
Subdivides this curve and stores the results into
left and right . |
public Point p1()
ICubicCurve
p1
in interface ICubicCurve
public Point ctrlP1()
ICubicCurve
ctrlP1
in interface ICubicCurve
public Point ctrlP2()
ICubicCurve
ctrlP2
in interface ICubicCurve
public Point p2()
ICubicCurve
p2
in interface ICubicCurve
public double flatnessSq()
ICubicCurve
flatnessSq
in interface ICubicCurve
public double flatness()
ICubicCurve
flatness
in interface ICubicCurve
public void subdivide(CubicCurve left, CubicCurve right)
ICubicCurve
left
and right
.subdivide
in interface ICubicCurve
public CubicCurve clone()
ICubicCurve
clone
in interface ICubicCurve
clone
in class Object
public boolean isEmpty()
IShape
public boolean contains(double px, double py)
IShape
public boolean contains(double rx, double ry, double rw, double rh)
IShape
public boolean contains(XY p)
IShape
public boolean contains(IRectangle r)
IShape
public boolean intersects(double rx, double ry, double rw, double rh)
IShape
intersects
in interface IShape
public boolean intersects(IRectangle r)
IShape
intersects
in interface IShape
public Rectangle bounds()
IShape
public Rectangle bounds(Rectangle target)
IShape
public PathIterator pathIterator(Transform t)
IShape
pathIterator
in interface IShape
t
- if supplied, the points in the path are transformed using this.public PathIterator pathIterator(Transform at, double flatness)
IShape
pathIterator
in interface IShape
at
- if supplied, the points in the path are transformed using this.flatness
- when approximating curved segments with lines, this controls the maximum
distance the lines are allowed to deviate from the approximated curve, thus a higher
flatness value generally allows for a path with fewer segments.Copyright © 2017. All rights reserved.