|
||||||||||
| 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.
Note: this class will be transformed to an interface in a future version.
Use the class CurveArray2D for implementations.
| Field Summary | |
|---|---|
protected ArrayList<T> |
curves
The inner array of curves |
| Fields inherited from interface math.geom2d.Shape2D |
|---|
ACCURACY |
| Constructor Summary | |
|---|---|
CurveSet2D()
Deprecated. use CurveArray2D instead |
|
CurveSet2D(Collection<? extends T> curves)
Deprecated. use CurveArray2D instead |
|
CurveSet2D(int n)
Deprecated. use CurveArray2D instead |
|
CurveSet2D(T[] curves)
Deprecated. use CurveArray2D instead |
|
| 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)
Clips a curve, and return a CurveSet2D. |
CurveSet2D<? extends Curve2D> |
clone()
Overrides Object declaration to ensure Curve2D implementation are cloned as Curve2D. |
boolean |
contains(double x,
double y)
Returns true if one of the curves contains the point |
boolean |
contains(Point2D p)
Returns true if one of the curves contains the point |
boolean |
containsCurve(T curve)
Checks if the curve set contains the given curve. |
void |
draw(Graphics2D g2)
Draws the curve on the given Graphics2D object. |
boolean |
equals(Object obj)
Returns 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)
Deprecated. use Curve2DUtils.fromUnitSegment() instead |
Shape |
getAsAWTShape()
|
Box2D |
getBoundingBox()
Returns bounding box for the CurveSet2D. |
T |
getChildCurve(double t)
Returns the child curve corresponding to a given position. |
Collection<? extends ContinuousCurve2D> |
getContinuousCurves()
Returns the collection of continuous curves which constitute this curve. |
T |
getCurve(int index)
Returns the inner curve corresponding to the given index. |
int |
getCurveIndex(double t)
Returns the index of the curve corresponding to a given position. |
int |
getCurveNumber()
Returns the number of curves in the collection |
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. |
double |
getDistance(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. |
GeneralPath |
getGeneralPath()
|
double |
getGlobalPosition(int i,
double t)
Converts a position on a curve (between t0 and t1 of the curve) to the position on the curve set (between 0 and 2*Nc-1). |
Collection<Point2D> |
getIntersections(LinearShape2D 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. |
double |
getLocalPosition(double t)
Converts the position on the curve set, which is comprised between 0 and 2*Nc-1 with Nc being the number of curves, to the position on the curve which contains the position. |
Point2D |
getPoint(double t)
Gets the point from a parametric representation of the curve. |
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. |
Collection<Point2D> |
getSingularPoints()
Computes the set of singular points as the set of singular points of each curve, plus the extremities of each curve. |
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 |
isBounded()
return true, if all curve pieces are bounded |
boolean |
isEmpty()
Returns true if the CurveSet does not contain any curve. |
boolean |
isSingular(double pos)
Checks if a point is singular. |
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)
Deprecated. use Curve2DUtils.toUnitSegment() instead |
CurveSet2D<? extends Curve2D> |
transform(AffineTransform2D trans)
Transforms each curve, and build a new CurveSet2D with the set of transformed curves. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ArrayList<T extends Curve2D> curves
| Constructor Detail |
|---|
@Deprecated public CurveSet2D()
@Deprecated public CurveSet2D(int n)
@Deprecated public CurveSet2D(T[] curves)
curves - the array of curves in the set@Deprecated public CurveSet2D(Collection<? extends T> curves)
curves - the collection of curves to add to the set| Method Detail |
|---|
@Deprecated
protected static final double toUnitSegment(double t,
double t0,
double t1)
t - a value between t0 and t1t0 - the lower bound of parameterization domaint1 - the upper bound of parameterization domain
@Deprecated
protected static final double fromUnitSegment(double t,
double t0,
double t1)
t - a value between 0 and 1t0 - the lower bound of parameterization domaint1 - the upper bound of parameterization domain
public double getLocalPosition(double t)
t - the position on the curve set
getGlobalPosition(int, double),
getCurveIndex(double)
public double getGlobalPosition(int i,
double t)
i - the index of the curve to considert - the position on the curve
getLocalPosition(double),
getCurveIndex(double)public int getCurveIndex(double t)
t - the position on the set of curves, between 0 and twice the
number of curves minus 1
public void addCurve(T curve)
curve - the curve to addpublic void removeCurve(T curve)
curve - the curve to removepublic boolean containsCurve(T curve)
public void clearCurves()
public Collection<T> getCurves()
public T getCurve(int index)
index - index of the curve
public T getChildCurve(double t)
t - the position on the set of curves, between 0 and twice the
number of curves
public T getFirstCurve()
public T getLastCurve()
public int getCurveNumber()
public boolean isEmpty()
isEmpty in interface Shape2Dpublic Collection<Point2D> getIntersections(LinearShape2D 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 Curve2Dpublic Point2D getFirstPoint()
getFirstPoint in interface Curve2Dpublic Point2D getLastPoint()
getLastPoint in interface Curve2Dpublic Collection<Point2D> getSingularPoints()
getSingularPoints in interface Curve2Dpublic boolean isSingular(double pos)
Curve2D
isSingular in interface Curve2Dpos - the position of the point on the curve
public 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(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 Collection<? extends ContinuousCurve2D> getContinuousCurves()
Curve2D
getContinuousCurves in interface Curve2Dpublic boolean contains(Point2D p)
contains in interface Shape2D
public boolean contains(double x,
double y)
contains in interface Shape2Dpublic GeneralPath getGeneralPath()
public Shape getAsAWTShape()
getAsAWTShape in interface Curve2Dpublic void draw(Graphics2D g2)
Curve2D
draw in interface Curve2Ddraw in interface Shape2Dg2 - the graphics to draw the curvepublic boolean equals(Object obj)
equals in class Objectpublic CurveSet2D<? extends Curve2D> clone()
Curve2D
clone in interface Curve2Dclone in class Objectpublic Iterator<T> iterator()
iterator in interface Iterable<T extends Curve2D>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||