|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmath.geom2d.line.Polyline2D
public class Polyline2D
A polyline is a continuous curve where each piece of the curve is a LineSegment2D.
| Field Summary | |
|---|---|
protected java.util.ArrayList<Point2D> |
points
|
| Fields inherited from interface math.geom2d.curve.ContinuousCurve2D |
|---|
CIRCLE, CLOSED_EDGE, LOOP, OPEN_EDGE |
| Fields inherited from interface math.geom2d.Shape2D |
|---|
ACCURACY, defaultClipWindow, EMPTY_SET |
| Constructor Summary | |
|---|---|
Polyline2D()
|
|
Polyline2D(java.util.Collection<? extends Point2D> points)
|
|
Polyline2D(double[] xcoords,
double[] ycoords)
|
|
Polyline2D(Point2D initialPoint)
|
|
Polyline2D(Point2D[] points)
|
|
| Method Summary | |
|---|---|
void |
addPoint(Point2D point)
|
java.awt.geom.GeneralPath |
appendPath(java.awt.geom.GeneralPath path)
Append the path of the curve to the given path. |
void |
clearPoints()
|
CurveSet2D<? extends Polyline2D> |
clip(Box2D box)
Clip the polyline by a box. |
boolean |
contains(double x,
double y)
|
boolean |
contains(double xr,
double yr,
double wr,
double hr)
Return false, as a curve can not contain a Rectangle |
boolean |
contains(java.awt.geom.Point2D point)
|
boolean |
contains(java.awt.geom.Rectangle2D rect)
Return false, as a curve can not contain a Rectangle |
boolean |
equals(java.lang.Object object)
|
Polyline2D |
getAsPolyline(int n)
Returns an approximation of the curve as a polyline with n
line segments. |
Box2D |
getBoundingBox()
Returns the bounding box of the shape. |
java.awt.Rectangle |
getBounds()
|
java.awt.geom.Rectangle2D |
getBounds2D()
|
java.util.Collection<ContinuousCurve2D> |
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. fillable) shape. |
double |
getDistance(java.awt.geom.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. |
java.util.Collection<LineSegment2D> |
getEdges()
return an array of LineSegment2D. |
Point2D |
getFirstPoint()
Get the first point of the curve. |
java.awt.geom.GeneralPath |
getGeneralPath()
Return a general path iterator. |
java.util.Collection<Point2D> |
getIntersections(StraightObject2D line)
Returns the intersection points of the curve with the specified line. |
Point2D |
getLastPoint()
if polyline is closed, return the first point. |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform trans)
Return pathiterator for this polyline. |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform trans,
double flatness)
Return pathiterator for this polyline. |
Point2D |
getPoint(double t)
Gets the point from a parametric representation of the curve. |
Point2D |
getPoint(double t,
Point2D point)
Same as getPoint(t), but gives the point as a parameter. |
Point2D[] |
getPointArray()
Return the collection of points as an array of Point2D. |
java.util.Collection<Point2D> |
getPoints()
Return the inner collection of points. |
java.util.Iterator<Point2D> |
getPointsIterator()
Return an iterator on the collection of points. |
double |
getPosition(Point2D point)
Get position of the point on the curve. |
Polyline2D |
getReverseCurve()
Returns the polyline with same points considered in reverse order. |
double |
getSignedDistance(double x,
double y)
The same as getSignedDistance(Point2D), but by passing 2 double as arguments. |
double |
getSignedDistance(java.awt.geom.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. |
java.util.Collection<? extends SmoothCurve2D> |
getSmoothPieces()
Returns a set of smooth 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. |
int |
getVerticesNumber()
|
double |
getWindingAngle(java.awt.geom.Point2D point)
Return the angle portion that the curve turn around the given point. |
boolean |
intersects(double xr,
double yr,
double wr,
double hr)
|
boolean |
intersects(java.awt.geom.Rectangle2D rect)
|
boolean |
isBounded()
Always returns true, because a polyline is always bounded. |
boolean |
isClosed()
return false, as Polyline2D is not closed by definition. |
boolean |
isInside(java.awt.geom.Point2D pt)
return true if the point is 'inside' the domain bounded by the curve. |
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 curve by an affine transform. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.ArrayList<Point2D> points
| Constructor Detail |
|---|
public Polyline2D()
public Polyline2D(Point2D initialPoint)
public Polyline2D(Point2D[] points)
public Polyline2D(java.util.Collection<? extends Point2D> points)
public Polyline2D(double[] xcoords,
double[] ycoords)
| Method Detail |
|---|
public java.util.Iterator<Point2D> getPointsIterator()
public Point2D[] getPointArray()
public void addPoint(Point2D point)
public void removePoint(Point2D point)
public void clearPoints()
public java.util.Collection<Point2D> getPoints()
public int getVerticesNumber()
public java.util.Collection<LineSegment2D> getEdges()
public Polyline2D getAsPolyline(int n)
ContinuousCurve2Dn
line segments. If the curve is closed, the method should return an
instance of ClosedPolyline2D.
getAsPolyline in interface ContinuousCurve2Dn - the number of line segments
n line segments.
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(java.awt.geom.Point2D point)
OrientedCurve2D
getSignedDistance in interface OrientedCurve2Dpoint - a point of the plane
public double getWindingAngle(java.awt.geom.Point2D point)
OrientedCurve2D
getWindingAngle in interface OrientedCurve2Dpoint - a point of the plane
public boolean isInside(java.awt.geom.Point2D pt)
OrientedCurve2D
isInside in interface OrientedCurve2Dpt - a point in the plane
public boolean isClosed()
isClosed in interface ContinuousCurve2Dpublic java.util.Collection<? extends SmoothCurve2D> getSmoothPieces()
ContinuousCurve2D
getSmoothPieces in interface ContinuousCurve2Dpublic java.util.Collection<Point2D> getIntersections(StraightObject2D line)
Curve2D
getIntersections in interface Curve2D
public Point2D getPoint(double t,
Point2D point)
Curve2D
getPoint 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 Curve2Dpublic Point2D getLastPoint()
getLastPoint in interface Curve2Dpublic boolean isBounded()
isBounded in interface Shape2Dpublic Polyline2D getReverseCurve()
getReverseCurve in interface ContinuousCurve2DgetReverseCurve in interface ContinuousOrientedCurve2DgetReverseCurve in interface Curve2DgetReverseCurve in interface OrientedCurve2Dpublic java.util.Collection<ContinuousCurve2D> getContinuousCurves()
Curve2D
getContinuousCurves in interface Curve2D
public Polyline2D getSubCurve(double t0,
double t1)
getSubCurve in interface ContinuousCurve2DgetSubCurve in interface ContinuousOrientedCurve2DgetSubCurve in interface Curve2Dt0 - position of the start of the sub-curvet1 - position of the end of the sub-curve
public CurveSet2D<? extends Polyline2D> clip(Box2D box)
clip in interface ContinuousCurve2Dclip in interface ContinuousOrientedCurve2Dclip in interface Curve2Dclip 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(java.awt.geom.Point2D point)
Shape2D
getDistance in interface Shape2Dpublic Polyline2D transform(AffineTransform2D trans)
Curve2D
transform in interface ContinuousCurve2Dtransform in interface ContinuousOrientedCurve2Dtransform in interface Curve2Dtransform in interface OrientedCurve2Dtransform in interface Shape2Dtrans - an affine transform
public boolean contains(double x,
double y)
contains in interface java.awt.Shapepublic boolean contains(java.awt.geom.Point2D point)
contains in interface java.awt.Shape
public boolean contains(double xr,
double yr,
double wr,
double hr)
contains in interface java.awt.Shapepublic boolean contains(java.awt.geom.Rectangle2D rect)
contains in interface java.awt.Shapepublic java.awt.Rectangle getBounds()
getBounds in interface java.awt.Shapepublic java.awt.geom.Rectangle2D getBounds2D()
getBounds2D in interface java.awt.Shape
public boolean intersects(double xr,
double yr,
double wr,
double hr)
intersects in interface java.awt.Shapepublic boolean intersects(java.awt.geom.Rectangle2D rect)
intersects in interface java.awt.Shapepublic java.awt.geom.GeneralPath appendPath(java.awt.geom.GeneralPath path)
ContinuousCurve2D
appendPath in interface ContinuousCurve2Dpath - a path to modify
public java.awt.geom.GeneralPath getGeneralPath()
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform trans)
getPathIterator in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform trans,
double flatness)
getPathIterator in interface java.awt.Shapepublic boolean equals(java.lang.Object object)
equals in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||