math.geom2d.curve
Class AbstractContinuousCurve2D
- java.lang.Object
-
- math.geom2d.curve.AbstractContinuousCurve2D
-
- All Implemented Interfaces:
- java.lang.Cloneable, ContinuousCurve2D, Curve2D, GeometricObject2D, Shape2D
- Direct Known Subclasses:
- AbstractSmoothCurve2D, LinearCurve2D
public abstract class AbstractContinuousCurve2D extends java.lang.Object implements ContinuousCurve2D, java.lang.Cloneable
Provides a base implementation for continuous curves.
-
-
Constructor Summary
Constructors Constructor and Description AbstractContinuousCurve2D()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description java.awt.ShapeasAwtShape()LinearCurve2DasPolyline(int n)Converts this continuous curve to an instance of LinearCurve2D with the given number of edges.abstract ContinuousCurve2Dclone()Deprecated.use copy constructor instead (0.11.2)java.util.Collection<? extends ContinuousCurve2D>continuousCurves()Returns the collection of continuous curves which constitute this curve.voiddraw(java.awt.Graphics2D g2)Draws the curve on the given Graphics2D object.Point2DfirstPoint()Returns the first point of the curve.Point2DlastPoint()Returns the last point of the curve.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface math.geom2d.curve.ContinuousCurve2D
appendPath, clip, curvature, isClosed, leftTangent, reverse, rightTangent, smoothPieces, subCurve, transform
-
Methods inherited from interface math.geom2d.curve.Curve2D
getT0, getT1, intersections, isSingular, point, position, project, singularPoints, t0, t1, vertices
-
Methods inherited from interface math.geom2d.Shape2D
boundingBox, contains, contains, distance, distance, isBounded, isEmpty
-
Methods inherited from interface math.geom2d.GeometricObject2D
almostEquals
-
-
-
-
Method Detail
-
asPolyline
public LinearCurve2D asPolyline(int n)
Converts this continuous curve to an instance of LinearCurve2D with the given number of edges. Returns either an instance of Polyline2D or LinearRing2D, depending on the curve is closed or not. This method can be overridden to return the correct type.- Specified by:
asPolylinein interfaceContinuousCurve2D- Parameters:
n- the number of line segments- Returns:
- a polyline with
nline segments. - See Also:
ContinuousCurve2D.asPolyline(int)
-
continuousCurves
public java.util.Collection<? extends ContinuousCurve2D> continuousCurves()
Description copied from interface:Curve2DReturns the collection of continuous curves which constitute this curve.- Specified by:
continuousCurvesin interfaceCurve2D- Returns:
- a collection of continuous curves.
-
firstPoint
public Point2D firstPoint()
Description copied from interface:Curve2DReturns the first point of the curve. It must returns the same result aspoint(t0()).- Specified by:
firstPointin interfaceCurve2D- Returns:
- the first point of the curve
- See Also:
Curve2D.t0(),Curve2D.point(double)
-
lastPoint
public Point2D lastPoint()
Description copied from interface:Curve2DReturns the last point of the curve. It must returns the same result asthis.point(this.t1()).- Specified by:
lastPointin interfaceCurve2D- Returns:
- the last point of the curve.
- See Also:
Curve2D.t1(),Curve2D.point(double)
-
draw
public void draw(java.awt.Graphics2D g2)
Description copied from interface:Curve2DDraws the curve on the given Graphics2D object.
-
asAwtShape
public java.awt.Shape asAwtShape()
- Specified by:
asAwtShapein interfaceCurve2D- Returns:
- the shape corresponding to this curve
-
clone
@Deprecated public abstract ContinuousCurve2D clone()
Deprecated. use copy constructor instead (0.11.2)
-
-
DMelt 3.0 © DataMelt by jWork.ORG