|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectmath.geom2d.curve.AbstractContinuousCurve2D
math.geom2d.polygon.Polyline2D
public class Polyline2D
A polyline is a continuous curve where each piece of the curve is a LineSegment2D.
| Field Summary | |
|---|---|
protected ArrayList<Point2D> |
points
|
| Fields inherited from interface math.geom2d.Shape2D |
|---|
ACCURACY |
| Constructor Summary | |
|---|---|
Polyline2D()
|
|
Polyline2D(Collection<? extends Point2D> points)
|
|
Polyline2D(double[] xcoords,
double[] ycoords)
|
|
Polyline2D(Point2D initialPoint)
|
|
Polyline2D(Point2D[] points)
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class math.geom2d.curve.AbstractContinuousCurve2D |
|---|
draw, getAsAWTShape, getAsPolyline, wrapCurve |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface math.geom2d.curve.ContinuousCurve2D |
|---|
getAsPolyline |
| Methods inherited from interface math.geom2d.curve.Curve2D |
|---|
draw, getAsAWTShape |
| Field Detail |
|---|
protected ArrayList<Point2D> points
| Constructor Detail |
|---|
public Polyline2D()
public Polyline2D(Point2D initialPoint)
public Polyline2D(Point2D[] points)
public Polyline2D(Collection<? extends Point2D> points)
public Polyline2D(double[] xcoords,
double[] ycoords)
| Method Detail |
|---|
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)
CirculinearShape2D
getBuffer in interface CirculinearShape2Ddist - the maximal distance between a point of the buffer and the
shape
public 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)
CirculinearShape2D
transform in interface CirculinearContinuousCurve2Dtransform in interface CirculinearCurve2Dtransform in interface CirculinearShape2Dtransform in interface ContinuousCirculinearCurve2Dinv - the circle inversion
public Vector2D getLeftTangent(double t)
getLeftTangent in interface ContinuousCurve2Dpublic Vector2D getRightTangent(double t)
getRightTangent in interface ContinuousCurve2D
public double getSignedDistance(double x,
double y)
OrientedCurve2D
getSignedDistance in interface OrientedCurve2Dx - x-coord of a pointy - y-coord of a point
public double getSignedDistance(Point2D point)
OrientedCurve2D
getSignedDistance in interface OrientedCurve2Dpoint - a point of the plane
public double getWindingAngle(Point2D point)
OrientedCurve2D
getWindingAngle in interface OrientedCurve2Dpoint - a point of the plane
public boolean isInside(Point2D pt)
OrientedCurve2D
isInside in interface OrientedCurve2Dpt - a point in the plane
public boolean isClosed()
isClosed in interface ContinuousCurve2Dpublic Collection<? extends LineSegment2D> getSmoothPieces()
CirculinearContinuousCurve2D
getSmoothPieces in interface CirculinearContinuousCurve2DgetSmoothPieces in interface ContinuousCirculinearCurve2DgetSmoothPieces in interface ContinuousCurve2Dpublic Collection<Point2D> getIntersections(LinearShape2D line)
Curve2D
getIntersections in interface Curve2Dpublic Point2D getPoint(double t)
Curve2D
getPoint in interface Curve2Dpublic double getPosition(Point2D point)
Curve2D
getPosition in interface Curve2Dpoint - a point belonging to the curve
public double project(Point2D point)
Curve2D
project in interface Curve2Dpoint - a point to project
public double getT0()
getT0 in interface Curve2Dpublic double getT1()
getT1 in interface Curve2Dpublic Point2D getFirstPoint()
Curve2DgetPoint(getT0()).
getFirstPoint in interface Curve2DgetFirstPoint in class AbstractContinuousCurve2Dpublic Point2D getLastPoint()
getLastPoint in interface Curve2DgetLastPoint in class AbstractContinuousCurve2Dpublic Collection<Point2D> getSingularPoints()
Curve2D
getSingularPoints in interface Curve2Dpublic boolean isSingular(double pos)
Curve2D
isSingular in interface Curve2Dpos - the position of the point on the curve
public 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()
Curve2D
getContinuousCurves in interface CirculinearCurve2DgetContinuousCurves in interface Curve2DgetContinuousCurves in class AbstractContinuousCurve2D
public 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-curve
public boolean isBounded()
isBounded in interface Shape2Dpublic boolean isEmpty()
isEmpty in interface Shape2Dpublic 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 box
public Box2D getBoundingBox()
Shape2D
getBoundingBox in interface Shape2D
public double getDistance(double x,
double y)
Shape2D
getDistance in interface Shape2Dpublic double getDistance(Point2D point)
Shape2D
getDistance in interface Shape2Dpublic Polyline2D transform(AffineTransform2D trans)
Shape2D
transform in interface ContinuousCurve2Dtransform in interface Curve2Dtransform in interface ContinuousOrientedCurve2Dtransform in interface OrientedCurve2Dtransform in interface Shape2Dtrans - an affine transform
public boolean contains(double x,
double y)
Shape2D
contains in interface Shape2Dpublic boolean contains(Point2D point)
Shape2D
contains in interface Shape2Dpublic GeneralPath appendPath(GeneralPath path)
ContinuousCurve2D
appendPath in interface ContinuousCurve2Dpath - a path to modify
public GeneralPath getGeneralPath()
public boolean equals(Object object)
equals in class Objectpublic Polyline2D clone()
Curve2D
clone in interface Curve2Dclone in class AbstractContinuousCurve2D
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||