math.geom2d.curve
Interface ContinuousCurve2D

All Superinterfaces:
Curve2D, java.awt.Shape, Shape2D
All Known Subinterfaces:
ContinuousBoundary2D, ContinuousOrientedCurve2D, SmoothCurve2D, SmoothOrientedCurve2D
All Known Implementing Classes:
BezierCurve2D, BoundaryPolyCurve2D, Circle2D, CircleArc2D, ClosedPolyline2D, Ellipse2D, EllipseArc2D, HyperbolaBranch2D, HyperbolaBranchArc2D, LineArc2D, LineObject2D, LineSegment2D, Parabola2D, ParabolaArc2D, PolyBezierCurve2D, PolyCurve2D, Polyline2D, PolyOrientedCurve2D, Ray2D, StraightLine2D, StraightObject2D

public interface ContinuousCurve2D
extends Curve2D

Interface for all curves which can be drawn with one stroke. This includes closed curves (ellipses, polygon boundaries...), infinite curves (straight lines, parabolas, ...), and 'finite' curves, such as polylines, conic arcs, line segments, splines... Note that an hyperbola is compound of 2 continuous curves.

Such curves accept parametric representation, in the form : p(t)={x(t),y(t)}, with t contained in appropriate domain. Bounds of domain of definition can be obtained by methods getT0() and getT1().


Field Summary
static int CIRCLE
           
static int CLOSED_EDGE
          constant for curves topologically equivalent to a closed edge.
static int LOOP
          Constant for curves topologically equivalent to a circle.
static int OPEN_EDGE
          Constant for curves topologically equivalent to an open edge.
 
Fields inherited from interface math.geom2d.Shape2D
ACCURACY, defaultClipWindow, EMPTY_SET
 
Method Summary
 java.awt.geom.GeneralPath appendPath(java.awt.geom.GeneralPath path)
          Append the path of the curve to the given path.
 CurveSet2D<? extends ContinuousCurve2D> clip(Box2D box)
          When a curve is clipped, the result is a set of curves.
 Polyline2D getAsPolyline(int n)
          Returns an approximation of the curve as a polyline with n line segments.
 ContinuousCurve2D getReverseCurve()
          Returns the curve with same trace on the plane with parametrization in reverse order.
 java.util.Collection<? extends SmoothCurve2D> getSmoothPieces()
          Returns a set of smooth curves.
 ContinuousCurve2D getSubCurve(double t0, double t1)
          Returns a portion of the original curve, delimited by two positions on the curve.
 boolean isClosed()
          Return true if the curve makes a loop, that is come back to starting point after covering the path.
 ContinuousCurve2D transform(AffineTransform2D trans)
          Transforms the curve by an affine transform.
 
Methods inherited from interface math.geom2d.curve.Curve2D
getContinuousCurves, getFirstPoint, getIntersections, getLastPoint, getPoint, getPoint, getPosition, getT0, getT1, project
 
Methods inherited from interface math.geom2d.Shape2D
getBoundingBox, getDistance, getDistance, isBounded
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, intersects, intersects
 

Field Detail

CLOSED_EDGE

static final int CLOSED_EDGE
constant for curves topologically equivalent to a closed edge. This is the case for line segment, conic finite arcs, circle or ellipse arcs, Bezize Curves...

See Also:
Constant Field Values

OPEN_EDGE

static final int OPEN_EDGE
Constant for curves topologically equivalent to an open edge. For example, straight lines, parabolas, or hyperbolas.

See Also:
Constant Field Values

LOOP

static final int LOOP
Constant for curves topologically equivalent to a circle. This includes circles, ellipses, simple polygon boundaries.

See Also:
Constant Field Values

CIRCLE

static final int CIRCLE
See Also:
Constant Field Values
Method Detail

isClosed

boolean isClosed()
Return true if the curve makes a loop, that is come back to starting point after covering the path.


getSmoothPieces

java.util.Collection<? extends SmoothCurve2D> getSmoothPieces()
Returns a set of smooth curves.


getAsPolyline

Polyline2D getAsPolyline(int n)
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 ClosedPolyline2D.

Parameters:
n - the number of line segments
Returns:
a closed polyline with n line segments.

appendPath

java.awt.geom.GeneralPath appendPath(java.awt.geom.GeneralPath path)
Append the path of the curve to the given path.

Parameters:
path - a path to modify
Returns:
the modified path

getReverseCurve

ContinuousCurve2D getReverseCurve()
Description copied from interface: Curve2D
Returns the curve with same trace on the plane with parametrization in reverse order.

Specified by:
getReverseCurve in interface Curve2D

getSubCurve

ContinuousCurve2D getSubCurve(double t0,
                              double t1)
Description copied from interface: Curve2D
Returns a portion of the original curve, delimited by two positions on the curve.

Specified by:
getSubCurve in interface Curve2D
Parameters:
t0 - position of the start of the sub-curve
t1 - position of the end of the sub-curve
Returns:
the portion of original curve comprised between t0 and t1.

clip

CurveSet2D<? extends ContinuousCurve2D> clip(Box2D box)
Description copied from interface: Curve2D
When a curve is clipped, the result is a set of curves.

Specified by:
clip in interface Curve2D
Specified by:
clip in interface Shape2D
Parameters:
box - the clipping box
Returns:
the clipped shape

transform

ContinuousCurve2D transform(AffineTransform2D trans)
Description copied from interface: Curve2D
Transforms the curve by an affine transform. The result is an instance of Curve2D.

Specified by:
transform in interface Curve2D
Specified by:
transform in interface Shape2D
Parameters:
trans - an affine transform
Returns:
the transformed shape