|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectmath.geom2d.curve.CurveSet2D<T>
math.geom2d.curve.CurveArray2D<T>
math.geom2d.curve.PolyCurve2D<T>
public class PolyCurve2D<T extends ContinuousCurve2D>
A PolyCurve2D is a set of piecewise smooth curve arcs, such that the end of a curve is the beginning of the next curve, and such that they do not intersect nor self-intersect.
| Field Summary | |
|---|---|
protected boolean |
closed
flag for indicating if the curve is closed or not (default is open) |
| Fields inherited from class math.geom2d.curve.CurveSet2D |
|---|
curves |
| Fields inherited from interface math.geom2d.Shape2D |
|---|
ACCURACY |
| Constructor Summary | |
|---|---|
PolyCurve2D()
|
|
PolyCurve2D(Collection<? extends T> curves)
|
|
PolyCurve2D(Collection<? extends T> curves,
boolean closed)
|
|
PolyCurve2D(int n)
|
|
PolyCurve2D(T[] curves)
|
|
PolyCurve2D(T[] curves,
boolean closed)
|
|
| Method Summary | ||
|---|---|---|
GeneralPath |
appendPath(GeneralPath path)
Append the path of the curve to the given path. |
|
CurveSet2D<? extends ContinuousCurve2D> |
clip(Box2D box)
Clip the PolyCurve2D by a box. |
|
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. |
|
Polyline2D |
getAsPolyline(int n)
Returns an approximation of the curve as a polyline with n
line segments. |
|
Collection<? extends PolyCurve2D<?>> |
getContinuousCurves()
Returns the collection of continuous curves which constitute this curve. |
|
GeneralPath |
getGeneralPath()
|
|
Vector2D |
getLeftTangent(double t)
|
|
PolyCurve2D<? extends ContinuousCurve2D> |
getReverseCurve()
Returns the curve with same trace on the plane with parametrization in reverse order. |
|
Vector2D |
getRightTangent(double t)
|
|
Collection<? extends SmoothCurve2D> |
getSmoothPieces()
Returns a collection containing only instances of SmoothCurve2D. |
|
PolyCurve2D<? extends ContinuousCurve2D> |
getSubCurve(double t0,
double t1)
Returns an instance of PolyCurve2D. |
|
boolean |
isClosed()
Returns true if the PolyCurve2D is closed. |
|
void |
setClosed(boolean b)
Toggle the 'closed' flag of the polycurve. |
|
PolyCurve2D<? extends ContinuousCurve2D> |
transform(AffineTransform2D trans)
Transforms each curve, and build a new CurveArray2D with the set of transformed curves. |
|
protected static
|
wrapCurve(T curve)
|
|
| Methods inherited from class math.geom2d.curve.CurveArray2D |
|---|
addCurve, clearCurves, clone, contains, contains, containsCurve, getAsAWTShape, getBoundingBox, getChildCurve, getCurve, getCurveIndex, getCurveNumber, getCurves, getDistance, getDistance, getFirstCurve, getFirstPoint, getGlobalPosition, getIntersections, getLastCurve, getLastPoint, getLocalPosition, getPoint, getPosition, getSingularPoints, getT0, getT1, isBounded, isEmpty, isSingular, iterator, project, removeCurve |
| 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 |
| Methods inherited from interface math.geom2d.curve.Curve2D |
|---|
clone, getAsAWTShape, getFirstPoint, getIntersections, getLastPoint, getPoint, getPosition, getSingularPoints, getT0, getT1, isSingular, project |
| Methods inherited from interface math.geom2d.Shape2D |
|---|
contains, contains, getBoundingBox, getDistance, getDistance, isBounded, isEmpty |
| Field Detail |
|---|
protected boolean closed
| Constructor Detail |
|---|
public PolyCurve2D()
public PolyCurve2D(int n)
public PolyCurve2D(T[] curves)
public PolyCurve2D(T[] curves,
boolean closed)
public PolyCurve2D(Collection<? extends T> curves)
public PolyCurve2D(Collection<? extends T> curves,
boolean closed)
| Method Detail |
|---|
protected static <T extends ContinuousCurve2D> Collection<T> wrapCurve(T curve)
public void setClosed(boolean b)
public Vector2D getLeftTangent(double t)
getLeftTangent in interface ContinuousCurve2Dpublic Vector2D getRightTangent(double t)
getRightTangent in interface ContinuousCurve2Dpublic boolean isClosed()
isClosed in interface ContinuousCurve2Dpublic Polyline2D getAsPolyline(int n)
ContinuousCurve2Dn
line segments. If the curve is closed, the method should return an
instance of Ring2D.
getAsPolyline in interface ContinuousCurve2Dn - the number of line segments
n line segments.public Collection<? extends SmoothCurve2D> getSmoothPieces()
getSmoothPieces in interface ContinuousCurve2Dpublic Collection<? extends PolyCurve2D<?>> getContinuousCurves()
Curve2D
getContinuousCurves in interface Curve2DgetContinuousCurves in class CurveArray2D<T extends ContinuousCurve2D>public PolyCurve2D<? extends ContinuousCurve2D> getReverseCurve()
Curve2D
getReverseCurve in interface ContinuousCurve2DgetReverseCurve in interface Curve2DgetReverseCurve in class CurveArray2D<T extends ContinuousCurve2D>
public PolyCurve2D<? extends ContinuousCurve2D> getSubCurve(double t0,
double t1)
getSubCurve in interface ContinuousCurve2DgetSubCurve in interface Curve2DgetSubCurve in class CurveArray2D<T extends ContinuousCurve2D>t0 - position of the start of the sub-curvet1 - position of the end of the sub-curve
public CurveSet2D<? extends ContinuousCurve2D> clip(Box2D box)
clip in interface ContinuousCurve2Dclip in interface Curve2Dclip in interface Shape2Dclip in class CurveArray2D<T extends ContinuousCurve2D>box - the clipping box
public PolyCurve2D<? extends ContinuousCurve2D> transform(AffineTransform2D trans)
CurveArray2D
transform in interface ContinuousCurve2Dtransform in interface Curve2Dtransform in interface Shape2Dtransform in class CurveArray2D<T extends ContinuousCurve2D>trans - an affine transform
public GeneralPath appendPath(GeneralPath path)
ContinuousCurve2D
appendPath in interface ContinuousCurve2Dpath - a path to modify
public GeneralPath getGeneralPath()
getGeneralPath in class CurveArray2D<T extends ContinuousCurve2D>public void draw(Graphics2D g2)
Curve2D
draw in interface Curve2Ddraw in interface Shape2Ddraw in class CurveArray2D<T extends ContinuousCurve2D>g2 - the graphics to draw the curvepublic boolean equals(Object obj)
CurveArray2D
equals in class CurveArray2D<T extends ContinuousCurve2D>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||