|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmath.geom2d.curve.CurveSet2D<T>
public class CurveSet2D<T extends Curve2D>
A parameterized set of curves. A curve cannot be included twice in a CurveSet2D.
| Field Summary | |
|---|---|
protected java.util.ArrayList<T> |
curves
The inner array of curves |
| Fields inherited from interface math.geom2d.Shape2D |
|---|
ACCURACY, defaultClipWindow, EMPTY_SET |
| Constructor Summary | |
|---|---|
CurveSet2D()
Empty constructor. |
|
CurveSet2D(java.util.Collection<? extends T> curves)
Constructor from a collection of curves. |
|
CurveSet2D(T[] curves)
Constructor from an array of curves. |
|
| Method Summary | |
|---|---|
void |
addCurve(T curve)
Adds the curve to the curve set, if it does not already belongs to the set. |
void |
clearCurves()
Clears the inner curve collection. |
CurveSet2D<? extends Curve2D> |
clip(Box2D box)
Clip a curve, and return a CurveSet2D. |
boolean |
contains(double x,
double y)
return true if one of the curves contains the point |
boolean |
contains(double x,
double y,
double w,
double h)
Always return false |
boolean |
contains(java.awt.geom.Point2D p)
return true if one of the curves contains the point |
boolean |
contains(java.awt.geom.Rectangle2D rect)
Always return false |
boolean |
equals(java.lang.Object obj)
Return true if obj is a CurveSet2D with the same number of curves, and such that each curve belongs to both objects. |
protected static double |
fromUnitSegment(double t,
double t0,
double t1)
Transform the value t between 0 and 1 in a value given between t0 and t1. |
Box2D |
getBoundingBox()
Return bounding box for the CurveSet2D. |
java.awt.Rectangle |
getBounds()
Return bounding box of the shape. |
java.awt.geom.Rectangle2D |
getBounds2D()
Return more precise bounds for the shape. |
java.util.Collection<ContinuousCurve2D> |
getContinuousCurves()
Returns the collection of continuous curves which constitute this curve. |
int |
getCurveNumber()
Returns the number of curves in the collection |
java.util.Collection<T> |
getCurves()
Returns the collection of curves |
double |
getDistance(double x,
double y)
get the distance of the shape to the given point, specified by x and y, or the distance of point to the frontier of the shape in the case of a plain (i.e. fillable) shape. |
double |
getDistance(java.awt.geom.Point2D p)
get the distance of the shape to the given point, or the distance of point to the frontier of the shape in the case of a plain shape. |
T |
getFirstCurve()
Returns the first curve of the collection if it exists, null otherwise. |
Point2D |
getFirstPoint()
Get the first point of the curve. |
protected java.awt.geom.GeneralPath |
getGeneralPath()
|
java.util.Collection<Point2D> |
getIntersections(StraightObject2D line)
Returns the intersection points of the curve with the specified line. |
T |
getLastCurve()
Returns the last curve of the collection if it exists, null otherwise. |
Point2D |
getLastPoint()
Get the last point of the curve. |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform trans)
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform trans,
double flatness)
|
Point2D |
getPoint(double t)
Gets the point from a parametric representation of the curve. |
Point2D |
getPoint(double t,
Point2D point)
Same as getPoint(t), but gives the point as a parameter. |
double |
getPosition(Point2D point)
Get position of the point on the curve. |
Curve2D |
getReverseCurve()
Returns the curve with same trace on the plane with parametrization in reverse order. |
CurveSet2D<? extends Curve2D> |
getSubCurve(double t0,
double t1)
Return an instance of CurveSet2D. |
double |
getT0()
Get value of parameter t for the first point of the curve. |
double |
getT1()
Get value of parameter t for the last point of the curve. |
boolean |
intersects(double x,
double y,
double w,
double h)
|
boolean |
intersects(java.awt.geom.Rectangle2D rect)
|
boolean |
isBounded()
return true, if all curve pieces are bounded |
boolean |
isEmpty()
Returns true if the CurveSet does not contain any curve. |
java.util.Iterator<T> |
iterator()
|
double |
project(Point2D point)
Returns the position of the closest orthogonal projection of the point on the curve, or of the closest singular point. |
void |
removeCurve(T curve)
Removes the specified curve from the curve set. |
protected static double |
toUnitSegment(double t,
double t0,
double t1)
Mapping of the parameter t, relative to the local curve, into the interval [0 1], [0 1[, ]0 1], or ]0 1[, depending on the values of t0 and t1. |
CurveSet2D<? extends Curve2D> |
transform(AffineTransform2D trans)
Transform each curve, and build a new CurveSet2D with the set of transformed curves. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.ArrayList<T extends Curve2D> curves
| Constructor Detail |
|---|
public CurveSet2D()
public CurveSet2D(T[] curves)
curves - the array of curves in the setpublic CurveSet2D(java.util.Collection<? extends T> curves)
curves - the collection of curves to add to the set| Method Detail |
|---|
protected static final double toUnitSegment(double t,
double t0,
double t1)
t - t0 - t1 -
protected static final double fromUnitSegment(double t,
double t0,
double t1)
t - t0 - t1 -
public void addCurve(T curve)
curve - the curve to addpublic void removeCurve(T curve)
curve - the curve to removepublic void clearCurves()
public java.util.Collection<T> getCurves()
public T getFirstCurve()
public T getLastCurve()
public int getCurveNumber()
public boolean isEmpty()
public java.util.Collection<Point2D> getIntersections(StraightObject2D line)
Curve2D
getIntersections in interface Curve2Dpublic double getT0()
Curve2D
getT0 in interface Curve2Dpublic double getT1()
Curve2D
getT1 in interface Curve2Dpublic Point2D getPoint(double t)
Curve2D
getPoint in interface Curve2D
public Point2D getPoint(double t,
Point2D point)
Curve2D
getPoint in interface Curve2Dpublic Point2D getFirstPoint()
getFirstPoint in interface Curve2Dpublic Point2D getLastPoint()
getLastPoint in interface Curve2Dpublic double getPosition(Point2D point)
Curve2D
getPosition in interface Curve2Dpoint - a point belonging to the curve
public double project(Point2D point)
Curve2D
project in interface Curve2Dpoint - a point to project
public Curve2D getReverseCurve()
Curve2D
getReverseCurve in interface Curve2D
public CurveSet2D<? extends Curve2D> getSubCurve(double t0,
double t1)
getSubCurve in interface Curve2Dt0 - position of the start of the sub-curvet1 - position of the end of the sub-curve
public double getDistance(java.awt.geom.Point2D p)
Shape2D
getDistance in interface Shape2D
public double getDistance(double x,
double y)
Shape2D
getDistance in interface Shape2Dpublic boolean isBounded()
isBounded in interface Shape2Dpublic CurveSet2D<? extends Curve2D> clip(Box2D box)
clip in interface Curve2Dclip in interface Shape2Dbox - the clipping box
public Box2D getBoundingBox()
getBoundingBox in interface Shape2Dpublic CurveSet2D<? extends Curve2D> transform(AffineTransform2D trans)
transform in interface Curve2Dtransform in interface Shape2Dtrans - an affine transform
public java.util.Collection<ContinuousCurve2D> getContinuousCurves()
Curve2D
getContinuousCurves in interface Curve2Dpublic boolean contains(java.awt.geom.Point2D p)
contains in interface java.awt.Shape
public boolean contains(double x,
double y)
contains in interface java.awt.Shapepublic boolean contains(java.awt.geom.Rectangle2D rect)
contains in interface java.awt.Shape
public boolean contains(double x,
double y,
double w,
double h)
contains in interface java.awt.Shapepublic java.awt.Rectangle getBounds()
getBounds in interface java.awt.Shapepublic java.awt.geom.Rectangle2D getBounds2D()
getBounds2D in interface java.awt.Shapepublic boolean intersects(java.awt.geom.Rectangle2D rect)
intersects in interface java.awt.Shape
public boolean intersects(double x,
double y,
double w,
double h)
intersects in interface java.awt.Shapeprotected java.awt.geom.GeneralPath getGeneralPath()
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform trans)
getPathIterator in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform trans,
double flatness)
getPathIterator in interface java.awt.Shapepublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T extends Curve2D>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||