public class Polyline2D extends AbstractContinuousCurve2D implements CirculinearContinuousCurve2D, Cloneable
| Constructor and Description |
|---|
Polyline2D() |
Polyline2D(Collection<? extends Point2D> points) |
Polyline2D(double[] xcoords,
double[] ycoords) |
Polyline2D(Point2D initialPoint) |
Polyline2D(Point2D[] points) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPoint(Point2D point) |
GeneralPath |
appendPath(GeneralPath path)
Append the path of the curve to the given path.
|
void |
clearPoints()
Deprecated.
replaced by clearVertices()
|
void |
clearVertices() |
CurveSet2D<? extends Polyline2D> |
clip(Box2D box)
Clip the polyline by a box.
|
Polyline2D |
clone()
Overrides Object declaration to ensure Curve2D implementation are
cloned as Curve2D.
|
boolean |
contains(double x,
double y)
Checks if the shape contains the planar point defined by (x,y).
|
boolean |
contains(Point2D point)
Checks if the shape contains the given point.
|
static Polyline2D |
create(Collection<? extends Point2D> points)
Static factory for creating a new Polyline2D from a collection of
points.
|
static Polyline2D |
create(Point2D[] points)
Static factory for creating a new Polyline2D from an array of
points.
|
boolean |
equals(Object object) |
Box2D |
getBoundingBox()
Returns the bounding box of the shape.
|
CirculinearDomain2D |
getBuffer(double dist)
Computes the buffer of the shape, formed by the set of points located
at a distance from the shape that is lower or equal to d.
|
Collection<? extends Polyline2D> |
getContinuousCurves()
Returns the collection of continuous curves which constitute this curve.
|
double |
getDistance(double x,
double y)
get the distance of the shape to the given point, specified by x and y,
or the distance of point to the frontier of the shape in the case of a
plain (i.e.
|
double |
getDistance(Point2D point)
get the distance of the shape to the given point, or the distance of
point to the frontier of the shape in the case of a plain shape.
|
LineSegment2D |
getEdge(int index) |
Collection<LineSegment2D> |
getEdges()
Returns an array of LineSegment2D.
|
LineSegment2D |
getFirstEdge() |
Point2D |
getFirstPoint()
Get the first point of the curve.
|
GeneralPath |
getGeneralPath()
Return a general path iterator.
|
Collection<Point2D> |
getIntersections(LinearShape2D line)
Returns the intersection points of the curve with the specified line.
|
LineSegment2D |
getLastEdge() |
Point2D |
getLastPoint()
if polyline is closed, return the first point.
|
Vector2D |
getLeftTangent(double t) |
double |
getLength() |
double |
getLength(double pos) |
CirculinearContinuousCurve2D |
getParallel(double d)
Creates a new curve, formed by the points with parameterization:
p(t) = c(t) + d*n(t)/|n(t)|, with p(t) being a point of
the original curve, n(t) the normal of the curve, and |n| being the
norm of n.In the case of a continuous curve formed by several smooth circulinear elements, the parallels of contiguous elements are joined by a circle arc. |
Point2D |
getPoint(double t)
Gets the point from a parametric representation of the curve.
|
Point2D[] |
getPointArray()
Return the collection of points as an array of Point2D.
|
Iterator<Point2D> |
getPointsIterator()
Return an iterator on the collection of points.
|
double |
getPosition(double length) |
double |
getPosition(Point2D point)
Get position of the point on the curve.
|
Polyline2D |
getReverseCurve()
Returns the polyline with same points considered in reverse order.
|
Vector2D |
getRightTangent(double t) |
double |
getSignedDistance(double x,
double y)
The same as getSignedDistance(Point2D), but by passing 2 double as
arguments.
|
double |
getSignedDistance(Point2D point)
Get the signed distance of the curve to the given point: this distance is
positive if the point lies outside the shape, and is negative if the
point lies inside the shape.
|
Collection<Point2D> |
getSingularPoints()
Returns a set of singular points, i.
|
Collection<? extends LineSegment2D> |
getSmoothPieces()
Returns a set of circulinear elements, which are basis for circulinear
curves.
|
Polyline2D |
getSubCurve(double t0,
double t1)
Return an instance of Polyline2D.
|
double |
getT0()
returns 0.
|
double |
getT1()
return the number of points in the polyline, minus one.
|
Point2D |
getVertex(int i)
Returns the i-th vertex of the polyline.
|
int |
getVertexNumber()
Returns the number of vertices.
|
Collection<Point2D> |
getVertices()
Returns the vertices of the polyline.
|
double |
getWindingAngle(Point2D point)
Return the angle portion that the curve turn around the given point.
|
boolean |
isBounded()
Always returns true, because a polyline is always bounded.
|
boolean |
isClosed()
return false, as Polyline2D is not closed by definition.
|
boolean |
isEmpty()
Returns true if the polyline does not contain any point.
|
boolean |
isInside(Point2D pt)
Returns true if the point is 'inside' the domain bounded by the curve.
|
boolean |
isSingular(double pos)
Checks if a point is singular.
|
double |
project(Point2D point)
Returns the position of the closest orthogonal projection of the point on
the curve, or of the closest singular point.
|
void |
removePoint(Point2D point) |
Polyline2D |
transform(AffineTransform2D trans)
Transforms the shape by an affine transform.
|
CirculinearContinuousCurve2D |
transform(CircleInversion2D inv)
Transforms the shape by a circle inversion.
|
draw, getAsAWTShape, getAsPolyline, wrapCurvefinalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAsPolylinedraw, getAsAWTShapepublic Polyline2D()
public Polyline2D(Point2D initialPoint)
public Polyline2D(Point2D[] points)
public Polyline2D(Collection<? extends Point2D> points)
public Polyline2D(double[] xcoords,
double[] ycoords)
public static Polyline2D create(Collection<? extends Point2D> points)
public static Polyline2D create(Point2D[] points)
public Iterator<Point2D> getPointsIterator()
public Point2D[] getPointArray()
public void addPoint(Point2D point)
public void removePoint(Point2D point)
@Deprecated public void clearPoints()
public void clearVertices()
public Collection<Point2D> getVertices()
public Point2D getVertex(int i)
i - index of the vertex, between 0 and the number of verticespublic int getVertexNumber()
public Collection<LineSegment2D> getEdges()
public LineSegment2D getEdge(int index)
public LineSegment2D getFirstEdge()
public LineSegment2D getLastEdge()
public double getLength()
getLength in interface CirculinearCurve2Dpublic double getLength(double pos)
getLength in interface CirculinearCurve2Dpublic double getPosition(double length)
getPosition in interface CirculinearCurve2Dpublic CirculinearDomain2D getBuffer(double dist)
CirculinearShape2DgetBuffer in interface CirculinearShape2Ddist - the maximal distance between a point of the buffer and the
shapepublic CirculinearContinuousCurve2D getParallel(double d)
CirculinearCurve2D p(t) = c(t) + d*n(t)/|n(t)|, with p(t) being a point of
the original curve, n(t) the normal of the curve, and |n| being the
norm of n.getParallel in interface CirculinearContinuousCurve2DgetParallel in interface CirculinearCurve2DgetParallel in interface ContinuousCirculinearCurve2Dd - the distance between the original curve and he parallel curve.public CirculinearContinuousCurve2D transform(CircleInversion2D inv)
CirculinearShape2Dtransform in interface CirculinearContinuousCurve2Dtransform in interface CirculinearCurve2Dtransform in interface CirculinearShape2Dtransform in interface ContinuousCirculinearCurve2Dinv - the circle inversionpublic Vector2D getLeftTangent(double t)
getLeftTangent in interface ContinuousCurve2Dpublic Vector2D getRightTangent(double t)
getRightTangent in interface ContinuousCurve2Dpublic double getSignedDistance(double x,
double y)
OrientedCurve2DgetSignedDistance in interface OrientedCurve2Dx - x-coord of a pointy - y-coord of a pointpublic double getSignedDistance(Point2D point)
OrientedCurve2DgetSignedDistance in interface OrientedCurve2Dpoint - a point of the planepublic double getWindingAngle(Point2D point)
OrientedCurve2DgetWindingAngle in interface OrientedCurve2Dpoint - a point of the planepublic boolean isInside(Point2D pt)
OrientedCurve2DisInside in interface OrientedCurve2Dpt - a point in the planepublic boolean isClosed()
isClosed in interface ContinuousCurve2Dpublic Collection<? extends LineSegment2D> getSmoothPieces()
CirculinearContinuousCurve2DgetSmoothPieces in interface CirculinearContinuousCurve2DgetSmoothPieces in interface ContinuousCirculinearCurve2DgetSmoothPieces in interface ContinuousCurve2Dpublic Collection<Point2D> getIntersections(LinearShape2D line)
Curve2DgetIntersections in interface Curve2Dpublic Point2D getPoint(double t)
Curve2Dpublic double getPosition(Point2D point)
Curve2DgetPosition in interface Curve2Dpoint - a point belonging to the curvepublic double project(Point2D point)
Curve2Dpublic double getT1()
public Point2D getFirstPoint()
Curve2DgetPoint(getT0()).getFirstPoint in interface Curve2DgetFirstPoint in class AbstractContinuousCurve2Dpublic Point2D getLastPoint()
getLastPoint in interface Curve2DgetLastPoint in class AbstractContinuousCurve2Dpublic Collection<Point2D> getSingularPoints()
Curve2DgetSingularPoints in interface Curve2Dpublic boolean isSingular(double pos)
Curve2DisSingular in interface Curve2Dpos - the position of the point on the curvepublic Polyline2D getReverseCurve()
getReverseCurve in interface CirculinearContinuousCurve2DgetReverseCurve in interface CirculinearCurve2DgetReverseCurve in interface ContinuousCirculinearCurve2DgetReverseCurve in interface ContinuousCurve2DgetReverseCurve in interface Curve2DgetReverseCurve in interface ContinuousOrientedCurve2DgetReverseCurve in interface OrientedCurve2Dpublic Collection<? extends Polyline2D> getContinuousCurves()
Curve2DgetContinuousCurves in interface CirculinearCurve2DgetContinuousCurves in interface Curve2DgetContinuousCurves in class AbstractContinuousCurve2Dpublic Polyline2D getSubCurve(double t0, double t1)
getSubCurve in interface CirculinearContinuousCurve2DgetSubCurve in interface CirculinearCurve2DgetSubCurve in interface ContinuousCirculinearCurve2DgetSubCurve in interface ContinuousCurve2DgetSubCurve in interface Curve2DgetSubCurve in interface ContinuousOrientedCurve2Dt0 - position of the start of the sub-curvet1 - position of the end of the sub-curvepublic boolean isBounded()
public boolean isEmpty()
public CurveSet2D<? extends Polyline2D> clip(Box2D box)
clip in interface CirculinearContinuousCurve2Dclip in interface CirculinearCurve2Dclip in interface ContinuousCirculinearCurve2Dclip in interface ContinuousCurve2Dclip in interface Curve2Dclip in interface ContinuousOrientedCurve2Dclip in interface OrientedCurve2Dclip in interface Shape2Dbox - the clipping boxpublic Box2D getBoundingBox()
Shape2DgetBoundingBox in interface Shape2Dpublic double getDistance(double x,
double y)
Shape2DgetDistance in interface Shape2Dpublic double getDistance(Point2D point)
Shape2DgetDistance in interface Shape2Dpublic Polyline2D transform(AffineTransform2D trans)
Shape2Dtransform in interface ContinuousCurve2Dtransform in interface Curve2Dtransform in interface ContinuousOrientedCurve2Dtransform in interface OrientedCurve2Dtransform in interface Shape2Dtrans - an affine transformpublic boolean contains(double x,
double y)
Shape2Dpublic boolean contains(Point2D point)
Shape2Dpublic GeneralPath appendPath(GeneralPath path)
ContinuousCurve2DappendPath in interface ContinuousCurve2Dpath - a path to modifypublic GeneralPath getGeneralPath()
public Polyline2D clone()
Curve2Dclone in interface Curve2Dclone in class AbstractContinuousCurve2DCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.