public class LinearRing2D extends Polyline2D implements CirculinearContour2D
A LinearRing2D is a Polyline2D whose last point is connected to the first one. This is typically the boundary of a SimplePolygon2D.
The name 'LinearRing2D' was used for 2 reasons:
points| Constructor and Description |
|---|
LinearRing2D() |
LinearRing2D(Collection<? extends Point2D> points) |
LinearRing2D(double[] xcoords,
double[] ycoords) |
LinearRing2D(Point2D initialPoint) |
LinearRing2D(Point2D[] points) |
| Modifier and Type | Method and Description |
|---|---|
GeneralPath |
appendPath(GeneralPath path)
Append the path of the curve to the given path.
|
LinearRing2D |
clone()
Overrides Object declaration to ensure Curve2D implementation are
cloned as Curve2D.
|
static LinearRing2D |
create(Collection<? extends Point2D> points)
Static factory for creating a new LinearRing2D from a collection of
points.
|
static LinearRing2D |
create(Point2D[] points)
Static factory for creating a new LinearRing2D from an array of
points.
|
boolean |
equals(Object object) |
void |
fill(Graphics2D g2) |
double |
getArea()
Computes area of the polyline, by returning the absolute value of the
signed area.
|
Collection<ContinuousBoundary2D> |
getBoundaryCurves()
Returns the different continuous curves composing the boundary
|
Collection<? extends LinearRing2D> |
getContinuousCurves()
Returns the collection of continuous curves which constitute this curve.
|
Domain2D |
getDomain()
Returns the domain delimited by this boundary.
|
Collection<LineSegment2D> |
getEdges()
Returns an array of LineSegment2D.
|
Point2D |
getFirstPoint()
return the first point of the polyline.
|
GeneralPath |
getGeneralPath()
Return a general path iterator.
|
LineSegment2D |
getLastEdge() |
Point2D |
getLastPoint()
return the first point, as this is the same as the last point.
|
CirculinearRing2D |
getParallel(double dist)
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)
Returns point from position as double.
|
LinearRing2D |
getReverseCurve()
Returns the closed polyline with same points taken in reverse order.
|
double |
getSignedArea()
Computes the signed area of the polyline.
|
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.
|
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.
|
double |
getWindingAngle(Point2D point)
Return the angle portion that the curve turn around the given point.
|
boolean |
isClosed()
return true, by definition.
|
boolean |
isInside(double x,
double y) |
boolean |
isInside(Point2D point)
Returns true if the point is 'inside' the domain bounded by the curve.
|
LinearRing2D |
transform(AffineTransform2D trans)
Return the transformed shape, as a ClosePolyline2D.
|
CirculinearContour2D |
transform(CircleInversion2D inv)
Transforms the shape by a circle inversion.
|
addPoint, clearPoints, clearVertices, clip, contains, contains, getBoundingBox, getBuffer, getDistance, getDistance, getEdge, getFirstEdge, getIntersections, getLeftTangent, getLength, getLength, getPointArray, getPointsIterator, getPosition, getPosition, getRightTangent, getSingularPoints, getSmoothPieces, getVertex, getVertexNumber, getVertices, isBounded, isEmpty, isSingular, project, removePointdraw, getAsAWTShape, getAsPolyline, wrapCurvefinalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclip, getSmoothPiecesgetLength, getLength, getPositiongetBuffergetAsPolyline, getLeftTangent, getRightTangentdraw, getAsAWTShape, getIntersections, getPosition, getSingularPoints, isSingular, projectcontains, contains, getBoundingBox, getDistance, getDistance, isBounded, isEmptyclippublic LinearRing2D()
public LinearRing2D(Point2D initialPoint)
public LinearRing2D(Point2D[] points)
public LinearRing2D(double[] xcoords,
double[] ycoords)
public LinearRing2D(Collection<? extends Point2D> points)
public static LinearRing2D create(Collection<? extends Point2D> points)
public static LinearRing2D create(Point2D[] points)
public double getArea()
public double getSignedArea()
public Collection<LineSegment2D> getEdges()
getEdges in class Polyline2Dpublic LineSegment2D getLastEdge()
getLastEdge in class Polyline2Dpublic CirculinearRing2D getParallel(double dist)
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 CirculinearContour2DgetParallel in interface CirculinearCurve2DgetParallel in interface ContinuousCirculinearCurve2DgetParallel in class Polyline2Ddist - the distance between the original curve and he parallel curve.public CirculinearContour2D transform(CircleInversion2D inv)
CirculinearShape2Dtransform in interface CirculinearBoundary2Dtransform in interface CirculinearContinuousCurve2Dtransform in interface CirculinearContour2Dtransform in interface CirculinearCurve2Dtransform in interface CirculinearShape2Dtransform in interface ContinuousCirculinearCurve2Dtransform in class Polyline2Dinv - the circle inversionpublic Collection<ContinuousBoundary2D> getBoundaryCurves()
Boundary2DgetBoundaryCurves in interface Boundary2Dpublic Domain2D getDomain()
Boundary2DgetDomain in interface Boundary2Dpublic void fill(Graphics2D g2)
fill in interface Boundary2Dpublic double getSignedDistance(double x,
double y)
OrientedCurve2DgetSignedDistance in interface OrientedCurve2DgetSignedDistance in class Polyline2Dx - x-coord of a pointy - y-coord of a pointpublic double getSignedDistance(Point2D point)
OrientedCurve2DgetSignedDistance in interface OrientedCurve2DgetSignedDistance in class Polyline2Dpoint - a point of the planepublic double getWindingAngle(Point2D point)
OrientedCurve2DgetWindingAngle in interface OrientedCurve2DgetWindingAngle in class Polyline2Dpoint - a point of the planepublic boolean isInside(double x,
double y)
public boolean isInside(Point2D point)
OrientedCurve2DisInside in interface Boundary2DisInside in interface OrientedCurve2DisInside in class Polyline2Dpoint - a point in the planepublic boolean isClosed()
isClosed in interface ContinuousCurve2DisClosed in class Polyline2Dpublic Point2D getPoint(double t)
getPoint in interface Curve2DgetPoint in class Polyline2Dpublic double getT0()
getT0 in interface Curve2DgetT0 in class Polyline2Dpublic double getT1()
getT1 in interface Curve2DgetT1 in class Polyline2Dpublic Point2D getFirstPoint()
getFirstPoint in interface Curve2DgetFirstPoint in class Polyline2Dpublic Point2D getLastPoint()
getLastPoint in interface Curve2DgetLastPoint in class Polyline2Dpublic Collection<? extends LinearRing2D> getContinuousCurves()
Curve2DgetContinuousCurves in interface CirculinearBoundary2DgetContinuousCurves in interface CirculinearCurve2DgetContinuousCurves in interface Curve2DgetContinuousCurves in class Polyline2Dpublic LinearRing2D getReverseCurve()
getReverseCurve in interface CirculinearBoundary2DgetReverseCurve in interface CirculinearContinuousCurve2DgetReverseCurve in interface CirculinearContour2DgetReverseCurve in interface CirculinearCurve2DgetReverseCurve in interface ContinuousCirculinearCurve2DgetReverseCurve in interface ContinuousCurve2DgetReverseCurve in interface Curve2DgetReverseCurve in interface Boundary2DgetReverseCurve in interface ContinuousBoundary2DgetReverseCurve in interface ContinuousOrientedCurve2DgetReverseCurve in interface OrientedCurve2DgetReverseCurve in class Polyline2Dpublic Polyline2D getSubCurve(double t0, double t1)
getSubCurve in interface CirculinearContinuousCurve2DgetSubCurve in interface CirculinearCurve2DgetSubCurve in interface ContinuousCirculinearCurve2DgetSubCurve in interface ContinuousCurve2DgetSubCurve in interface Curve2DgetSubCurve in interface ContinuousOrientedCurve2DgetSubCurve in class Polyline2Dt0 - position of the start of the sub-curvet1 - position of the end of the sub-curvepublic LinearRing2D transform(AffineTransform2D trans)
transform in interface ContinuousCurve2Dtransform in interface Curve2Dtransform in interface Boundary2Dtransform in interface ContinuousBoundary2Dtransform in interface ContinuousOrientedCurve2Dtransform in interface OrientedCurve2Dtransform in interface Shape2Dtransform in class Polyline2Dtrans - an affine transformpublic GeneralPath appendPath(GeneralPath path)
ContinuousCurve2DappendPath in interface ContinuousCurve2DappendPath in class Polyline2Dpath - a path to modifypublic GeneralPath getGeneralPath()
getGeneralPath in class Polyline2Dpublic boolean equals(Object object)
equals in class Polyline2Dpublic LinearRing2D clone()
Curve2Dclone in interface Curve2Dclone in class Polyline2DCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.