math.geom2d.curve
Class AbstractContinuousCurve2D

Package class diagram package AbstractContinuousCurve2D
java.lang.Object
  extended by math.geom2d.curve.AbstractContinuousCurve2D
All Implemented Interfaces:
Serializable, Cloneable, ContinuousCurve2D, Curve2D, Shape2D
Direct Known Subclasses:
AbstractSmoothCurve2D, Polyline2D

public abstract class AbstractContinuousCurve2D
extends Object
implements ContinuousCurve2D, Cloneable

Provides a base implementation for smooth curves.

Author:
dlegland
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface math.geom2d.Shape2D
ACCURACY
 
Constructor Summary
AbstractContinuousCurve2D()
           
 
Method Summary
abstract  ContinuousCurve2D clone()
          Overrides Object declaration to ensure Curve2D implementation are cloned as Curve2D.
 void draw(Graphics2D g2)
          Draws the curve on the given Graphics2D object.
 Shape getAsAWTShape()
           
 Polyline2D getAsPolyline(int n)
          Returns an approximation of the curve as a polyline with n line segments.
 Collection<? extends ContinuousCurve2D> getContinuousCurves()
          Returns the collection of continuous curves which constitute this curve.
 Point2D getFirstPoint()
          Get the first point of the curve.
 Point2D getLastPoint()
          Get the last point of the curve.
protected static
<T extends ContinuousCurve2D>
Collection<T>
wrapCurve(T curve)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface math.geom2d.curve.ContinuousCurve2D
appendPath, clip, getLeftTangent, getReverseCurve, getRightTangent, getSmoothPieces, getSubCurve, isClosed, transform
 
Methods inherited from interface math.geom2d.curve.Curve2D
getIntersections, getPoint, getPosition, getSingularPoints, getT0, getT1, isSingular, project
 
Methods inherited from interface math.geom2d.Shape2D
contains, contains, getBoundingBox, getDistance, getDistance, isBounded, isEmpty
 

Constructor Detail

AbstractContinuousCurve2D

public AbstractContinuousCurve2D()
Method Detail

wrapCurve

protected static <T extends ContinuousCurve2D> Collection<T> wrapCurve(T curve)

getAsPolyline

public Polyline2D getAsPolyline(int n)
Description copied from interface: ContinuousCurve2D
Returns an approximation of the curve as a polyline with n line segments. If the curve is closed, the method should return an instance of Ring2D.

Specified by:
getAsPolyline in interface ContinuousCurve2D
Parameters:
n - the number of line segments
Returns:
a polyline with n line segments.

getContinuousCurves

public Collection<? extends ContinuousCurve2D> getContinuousCurves()
Description copied from interface: Curve2D
Returns the collection of continuous curves which constitute this curve.

Specified by:
getContinuousCurves in interface Curve2D
Returns:
a collection of continuous curves.

getFirstPoint

public Point2D getFirstPoint()
Description copied from interface: Curve2D
Get the first point of the curve. It must returns the same result as getPoint(getT0()).

Specified by:
getFirstPoint in interface Curve2D
Returns:
the first point of the curve

getLastPoint

public Point2D getLastPoint()
Description copied from interface: Curve2D
Get the last point of the curve. It must returns the same result as getPoint(getT1()).

Specified by:
getLastPoint in interface Curve2D
Returns:
the last point of the curve.

draw

public void draw(Graphics2D g2)
Description copied from interface: Curve2D
Draws the curve on the given Graphics2D object.

Specified by:
draw in interface Curve2D
Specified by:
draw in interface Shape2D
Parameters:
g2 - the graphics to draw the curve

getAsAWTShape

public Shape getAsAWTShape()
Specified by:
getAsAWTShape in interface Curve2D
Returns:
the shape corresponding to this curve

clone

public abstract ContinuousCurve2D clone()
Description copied from interface: Curve2D
Overrides Object declaration to ensure Curve2D implementation are cloned as Curve2D.

Specified by:
clone in interface Curve2D
Overrides:
clone in class Object
Returns:
the cloned curve


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.