|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object math.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 CirculinearCurve2D
public double getLength(double pos)
getLength
in interface CirculinearCurve2D
public double getPosition(double length)
getPosition
in interface CirculinearCurve2D
public CirculinearDomain2D getBuffer(double dist)
CirculinearShape2D
getBuffer
in interface CirculinearShape2D
dist
- 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 CirculinearContinuousCurve2D
getParallel
in interface CirculinearCurve2D
getParallel
in interface ContinuousCirculinearCurve2D
d
- the distance between the original curve and he parallel curve.
public CirculinearContinuousCurve2D transform(CircleInversion2D inv)
CirculinearShape2D
transform
in interface CirculinearContinuousCurve2D
transform
in interface CirculinearCurve2D
transform
in interface CirculinearShape2D
transform
in interface ContinuousCirculinearCurve2D
inv
- the circle inversion
public Vector2D getLeftTangent(double t)
getLeftTangent
in interface ContinuousCurve2D
public Vector2D getRightTangent(double t)
getRightTangent
in interface ContinuousCurve2D
public double getSignedDistance(double x, double y)
OrientedCurve2D
getSignedDistance
in interface OrientedCurve2D
x
- x-coord of a pointy
- y-coord of a point
public double getSignedDistance(Point2D point)
OrientedCurve2D
getSignedDistance
in interface OrientedCurve2D
point
- a point of the plane
public double getWindingAngle(Point2D point)
OrientedCurve2D
getWindingAngle
in interface OrientedCurve2D
point
- a point of the plane
public boolean isInside(Point2D pt)
OrientedCurve2D
isInside
in interface OrientedCurve2D
pt
- a point in the plane
public boolean isClosed()
isClosed
in interface ContinuousCurve2D
public Collection<? extends LineSegment2D> getSmoothPieces()
CirculinearContinuousCurve2D
getSmoothPieces
in interface CirculinearContinuousCurve2D
getSmoothPieces
in interface ContinuousCirculinearCurve2D
getSmoothPieces
in interface ContinuousCurve2D
public Collection<Point2D> getIntersections(LinearShape2D line)
Curve2D
getIntersections
in interface Curve2D
public Point2D getPoint(double t)
Curve2D
getPoint
in interface Curve2D
public double getPosition(Point2D point)
Curve2D
getPosition
in interface Curve2D
point
- a point belonging to the curve
public double project(Point2D point)
Curve2D
project
in interface Curve2D
point
- a point to project
public double getT0()
getT0
in interface Curve2D
public double getT1()
getT1
in interface Curve2D
public Point2D getFirstPoint()
Curve2D
getPoint(getT0())
.
getFirstPoint
in interface Curve2D
getFirstPoint
in class AbstractContinuousCurve2D
public Point2D getLastPoint()
getLastPoint
in interface Curve2D
getLastPoint
in class AbstractContinuousCurve2D
public Collection<Point2D> getSingularPoints()
Curve2D
getSingularPoints
in interface Curve2D
public boolean isSingular(double pos)
Curve2D
isSingular
in interface Curve2D
pos
- the position of the point on the curve
public Polyline2D getReverseCurve()
getReverseCurve
in interface CirculinearContinuousCurve2D
getReverseCurve
in interface CirculinearCurve2D
getReverseCurve
in interface ContinuousCirculinearCurve2D
getReverseCurve
in interface ContinuousCurve2D
getReverseCurve
in interface Curve2D
getReverseCurve
in interface ContinuousOrientedCurve2D
getReverseCurve
in interface OrientedCurve2D
public Collection<? extends Polyline2D> getContinuousCurves()
Curve2D
getContinuousCurves
in interface CirculinearCurve2D
getContinuousCurves
in interface Curve2D
getContinuousCurves
in class AbstractContinuousCurve2D
public Polyline2D getSubCurve(double t0, double t1)
getSubCurve
in interface CirculinearContinuousCurve2D
getSubCurve
in interface CirculinearCurve2D
getSubCurve
in interface ContinuousCirculinearCurve2D
getSubCurve
in interface ContinuousCurve2D
getSubCurve
in interface Curve2D
getSubCurve
in interface ContinuousOrientedCurve2D
t0
- position of the start of the sub-curvet1
- position of the end of the sub-curve
public boolean isBounded()
isBounded
in interface Shape2D
public boolean isEmpty()
isEmpty
in interface Shape2D
public CurveSet2D<? extends Polyline2D> clip(Box2D box)
clip
in interface CirculinearContinuousCurve2D
clip
in interface CirculinearCurve2D
clip
in interface ContinuousCirculinearCurve2D
clip
in interface ContinuousCurve2D
clip
in interface Curve2D
clip
in interface ContinuousOrientedCurve2D
clip
in interface OrientedCurve2D
clip
in interface Shape2D
box
- the clipping box
public Box2D getBoundingBox()
Shape2D
getBoundingBox
in interface Shape2D
public double getDistance(double x, double y)
Shape2D
getDistance
in interface Shape2D
public double getDistance(Point2D point)
Shape2D
getDistance
in interface Shape2D
public Polyline2D transform(AffineTransform2D trans)
Shape2D
transform
in interface ContinuousCurve2D
transform
in interface Curve2D
transform
in interface ContinuousOrientedCurve2D
transform
in interface OrientedCurve2D
transform
in interface Shape2D
trans
- an affine transform
public boolean contains(double x, double y)
Shape2D
contains
in interface Shape2D
public boolean contains(Point2D point)
Shape2D
contains
in interface Shape2D
public GeneralPath appendPath(GeneralPath path)
ContinuousCurve2D
appendPath
in interface ContinuousCurve2D
path
- a path to modify
public GeneralPath getGeneralPath()
public boolean equals(Object object)
equals
in class Object
public Polyline2D clone()
Curve2D
clone
in interface Curve2D
clone
in class AbstractContinuousCurve2D
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |