|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object math.geom2d.curve.CurveSet2D<T> math.geom2d.curve.CurveArray2D<T>
public class CurveArray2D<T extends Curve2D>
A parameterized set of curves. A curve cannot be included twice in a CurveArray2D.
The k-th curve contains points with positions between 2*k and 2*k+1. This allows to differentiate extremities of contiguous curves. The points with positions t between 2*k+1 and 2*k+2 belong to the curve k if t<2*k+1.5, or to the curve k+1 if t>2*k+1.5
Field Summary |
---|
Fields inherited from class math.geom2d.curve.CurveSet2D |
---|
curves |
Fields inherited from interface math.geom2d.Shape2D |
---|
ACCURACY |
Constructor Summary | |
---|---|
CurveArray2D()
Empty constructor. |
|
CurveArray2D(Collection<? extends T> curves)
Constructor from a collection of curves. |
|
CurveArray2D(int n)
Empty constructor. |
|
CurveArray2D(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)
Clips a curve, and return a CurveArray2D. |
CurveArray2D<? 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(Curve2D 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 CurveArray2D with the same number of curves, and such that each curve belongs to both objects. |
Shape |
getAsAWTShape()
|
Box2D |
getBoundingBox()
Returns bounding box for the CurveArray2D. |
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 CurveArray2D. |
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. |
CurveArray2D<? extends Curve2D> |
transform(AffineTransform2D trans)
Transforms each curve, and build a new CurveArray2D with the set of transformed curves. |
Methods inherited from class math.geom2d.curve.CurveSet2D |
---|
fromUnitSegment, toUnitSegment |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CurveArray2D()
public CurveArray2D(int n)
public CurveArray2D(T[] curves)
curves
- the array of curves in the setpublic CurveArray2D(Collection<? extends T> curves)
curves
- the collection of curves to add to the setMethod Detail |
---|
public double getLocalPosition(double t)
getLocalPosition
in class CurveSet2D<T extends Curve2D>
t
- the position on the curve set
getGlobalPosition(int, double)
,
getCurveIndex(double)
public double getGlobalPosition(int i, double t)
getGlobalPosition
in class CurveSet2D<T extends Curve2D>
i
- the index of the curve to considert
- the position on the curve
getLocalPosition(double)
,
getCurveIndex(double)
public int getCurveIndex(double t)
getCurveIndex
in class CurveSet2D<T extends Curve2D>
t
- the position on the set of curves, between 0 and twice the
number of curves minus 1
public void addCurve(T curve)
addCurve
in class CurveSet2D<T extends Curve2D>
curve
- the curve to addpublic void removeCurve(T curve)
removeCurve
in class CurveSet2D<T extends Curve2D>
curve
- the curve to removepublic boolean containsCurve(Curve2D curve)
containsCurve
in class CurveSet2D<T extends Curve2D>
public void clearCurves()
clearCurves
in class CurveSet2D<T extends Curve2D>
public Collection<T> getCurves()
getCurves
in class CurveSet2D<T extends Curve2D>
public T getCurve(int index)
getCurve
in class CurveSet2D<T extends Curve2D>
index
- index of the curve
public T getChildCurve(double t)
getChildCurve
in class CurveSet2D<T extends Curve2D>
t
- the position on the set of curves, between 0 and twice the
number of curves
public T getFirstCurve()
getFirstCurve
in class CurveSet2D<T extends Curve2D>
public T getLastCurve()
getLastCurve
in class CurveSet2D<T extends Curve2D>
public int getCurveNumber()
getCurveNumber
in class CurveSet2D<T extends Curve2D>
public boolean isEmpty()
isEmpty
in interface Shape2D
isEmpty
in class CurveSet2D<T extends Curve2D>
public Collection<Point2D> getIntersections(LinearShape2D line)
Curve2D
getIntersections
in interface Curve2D
getIntersections
in class CurveSet2D<T extends Curve2D>
public double getT0()
Curve2D
getT0
in interface Curve2D
getT0
in class CurveSet2D<T extends Curve2D>
public double getT1()
Curve2D
getT1
in interface Curve2D
getT1
in class CurveSet2D<T extends Curve2D>
public Point2D getPoint(double t)
Curve2D
getPoint
in interface Curve2D
getPoint
in class CurveSet2D<T extends Curve2D>
public Point2D getFirstPoint()
getFirstPoint
in interface Curve2D
getFirstPoint
in class CurveSet2D<T extends Curve2D>
public Point2D getLastPoint()
getLastPoint
in interface Curve2D
getLastPoint
in class CurveSet2D<T extends Curve2D>
public Collection<Point2D> getSingularPoints()
getSingularPoints
in interface Curve2D
getSingularPoints
in class CurveSet2D<T extends Curve2D>
public boolean isSingular(double pos)
Curve2D
isSingular
in interface Curve2D
isSingular
in class CurveSet2D<T extends Curve2D>
pos
- the position of the point on the curve
public double getPosition(Point2D point)
Curve2D
getPosition
in interface Curve2D
getPosition
in class CurveSet2D<T extends Curve2D>
point
- a point belonging to the curve
public double project(Point2D point)
Curve2D
project
in interface Curve2D
project
in class CurveSet2D<T extends Curve2D>
point
- a point to project
public Curve2D getReverseCurve()
Curve2D
getReverseCurve
in interface Curve2D
getReverseCurve
in class CurveSet2D<T extends Curve2D>
public CurveSet2D<? extends Curve2D> getSubCurve(double t0, double t1)
getSubCurve
in interface Curve2D
getSubCurve
in class CurveSet2D<T extends Curve2D>
t0
- 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
getDistance
in class CurveSet2D<T extends Curve2D>
public double getDistance(double x, double y)
Shape2D
getDistance
in interface Shape2D
getDistance
in class CurveSet2D<T extends Curve2D>
public boolean isBounded()
isBounded
in interface Shape2D
isBounded
in class CurveSet2D<T extends Curve2D>
public CurveSet2D<? extends Curve2D> clip(Box2D box)
clip
in interface Curve2D
clip
in interface Shape2D
clip
in class CurveSet2D<T extends Curve2D>
box
- the clipping box
public Box2D getBoundingBox()
getBoundingBox
in interface Shape2D
getBoundingBox
in class CurveSet2D<T extends Curve2D>
public CurveArray2D<? extends Curve2D> transform(AffineTransform2D trans)
transform
in interface Curve2D
transform
in interface Shape2D
transform
in class CurveSet2D<T extends Curve2D>
trans
- an affine transform
public Collection<? extends ContinuousCurve2D> getContinuousCurves()
Curve2D
getContinuousCurves
in interface Curve2D
getContinuousCurves
in class CurveSet2D<T extends Curve2D>
public boolean contains(Point2D p)
contains
in interface Shape2D
contains
in class CurveSet2D<T extends Curve2D>
public boolean contains(double x, double y)
contains
in interface Shape2D
contains
in class CurveSet2D<T extends Curve2D>
public GeneralPath getGeneralPath()
getGeneralPath
in class CurveSet2D<T extends Curve2D>
public Shape getAsAWTShape()
getAsAWTShape
in interface Curve2D
getAsAWTShape
in class CurveSet2D<T extends Curve2D>
public void draw(Graphics2D g2)
Curve2D
draw
in interface Curve2D
draw
in interface Shape2D
draw
in class CurveSet2D<T extends Curve2D>
g2
- the graphics to draw the curvepublic boolean equals(Object obj)
equals
in class CurveSet2D<T extends Curve2D>
public CurveArray2D<? extends Curve2D> clone()
Curve2D
clone
in interface Curve2D
clone
in class CurveSet2D<T extends Curve2D>
public Iterator<T> iterator()
iterator
in interface Iterable<T extends Curve2D>
iterator
in class CurveSet2D<T extends Curve2D>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |