public abstract class AbstractQuadCurve extends Object implements IQuadCurve
IQuadCurve
, obtaining only the start, end and
control point from the derived class.Constructor and Description |
---|
AbstractQuadCurve() |
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.
|
QuadCurve |
clone()
Returns a mutable copy of this curve.
|
boolean |
contains(float px,
float py)
Returns true if this shape contains the specified point.
|
boolean |
contains(float rx,
float ry,
float rw,
float 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 |
ctrlP()
Returns a copy of the control point of this curve.
|
float |
flatness()
Returns the flatness (maximum distance of a control point from the line connecting the end
points) of this curve.
|
float |
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(float rx,
float ry,
float rw,
float 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 t,
float flatness)
Returns an iterator over the path described by this shape.
|
void |
subdivide(QuadCurve left,
QuadCurve right)
Subdivides this curve and stores the results into
left and right . |
public Point p1()
IQuadCurve
p1
in interface IQuadCurve
public Point ctrlP()
IQuadCurve
ctrlP
in interface IQuadCurve
public Point p2()
IQuadCurve
p2
in interface IQuadCurve
public float flatnessSq()
IQuadCurve
flatnessSq
in interface IQuadCurve
public float flatness()
IQuadCurve
flatness
in interface IQuadCurve
public void subdivide(QuadCurve left, QuadCurve right)
IQuadCurve
left
and right
.subdivide
in interface IQuadCurve
public QuadCurve clone()
IQuadCurve
clone
in interface IQuadCurve
clone
in class Object
public boolean isEmpty()
IShape
public boolean contains(float px, float py)
IShape
public boolean contains(float rx, float ry, float rw, float rh)
IShape
public boolean contains(XY p)
IShape
public boolean contains(IRectangle r)
IShape
public boolean intersects(float rx, float ry, float rw, float 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 t, float flatness)
IShape
pathIterator
in interface IShape
t
- 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.