public class PolyCurve2D<T extends ContinuousCurve2D> extends CurveArray2D<T> implements ContinuousCurve2D
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed
flag for indicating if the curve is closed or not (default is open)
|
curves| Constructor and Description |
|---|
PolyCurve2D() |
PolyCurve2D(Collection<? extends T> curves) |
PolyCurve2D(Collection<? extends T> curves,
boolean closed) |
PolyCurve2D(int n) |
PolyCurve2D(T[] curves) |
PolyCurve2D(T[] curves,
boolean closed) |
| Modifier and Type | Method and Description |
|---|---|
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 <T extends ContinuousCurve2D> |
wrapCurve(T curve) |
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, removeCurvefromUnitSegment, toUnitSegmentfinalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclone, getAsAWTShape, getFirstPoint, getIntersections, getLastPoint, getPoint, getPosition, getSingularPoints, getT0, getT1, isSingular, projectcontains, contains, getBoundingBox, getDistance, getDistance, isBounded, isEmptyprotected boolean closed
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)
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 segmentsn line segments.public Collection<? extends SmoothCurve2D> getSmoothPieces()
getSmoothPieces in interface ContinuousCurve2Dpublic Collection<? extends PolyCurve2D<?>> getContinuousCurves()
Curve2DgetContinuousCurves in interface Curve2DgetContinuousCurves in class CurveArray2D<T extends ContinuousCurve2D>public PolyCurve2D<? extends ContinuousCurve2D> getReverseCurve()
Curve2DgetReverseCurve 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-curvepublic 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 boxpublic PolyCurve2D<? extends ContinuousCurve2D> transform(AffineTransform2D trans)
CurveArray2Dtransform in interface ContinuousCurve2Dtransform in interface Curve2Dtransform in interface Shape2Dtransform in class CurveArray2D<T extends ContinuousCurve2D>trans - an affine transformpublic GeneralPath appendPath(GeneralPath path)
ContinuousCurve2DappendPath in interface ContinuousCurve2Dpath - a path to modifypublic GeneralPath getGeneralPath()
getGeneralPath in class CurveArray2D<T extends ContinuousCurve2D>public void draw(Graphics2D g2)
Curve2Ddraw in interface Curve2Ddraw in interface Shape2Ddraw in class CurveArray2D<T extends ContinuousCurve2D>g2 - the graphics to draw the curvepublic boolean equals(Object obj)
CurveArray2Dequals in class CurveArray2D<T extends ContinuousCurve2D>Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.