math.geom2d.domain
Class BoundaryPolyCurve2D<T extends ContinuousOrientedCurve2D>
- java.lang.Object
-
- math.geom2d.curve.CurveArray2D<T>
-
- math.geom2d.curve.PolyCurve2D<T>
-
- math.geom2d.domain.PolyOrientedCurve2D<T>
-
- math.geom2d.domain.BoundaryPolyCurve2D<T>
-
- All Implemented Interfaces:
- java.lang.Cloneable, java.lang.Iterable<T>, ContinuousCurve2D, Curve2D, CurveSet2D<T>, Boundary2D, ContinuousOrientedCurve2D, Contour2D, OrientedCurve2D, GeometricObject2D, Shape2D, ShapeSet2D<T>
public class BoundaryPolyCurve2D<T extends ContinuousOrientedCurve2D> extends PolyOrientedCurve2D<T> implements Contour2D
A single continuous oriented curve, which defines the boundary of a planar domain. The boundary curve is composed of several continuous and oriented curves linked together to form a continuous curve. The resulting boundary curve is either a closed curve, or an infinite curve at both ends.
-
-
Constructor Summary
Constructors Constructor and Description BoundaryPolyCurve2D()Creates an empty BoundaryPolyCurve2D.BoundaryPolyCurve2D(java.util.Collection<? extends T> curves)Creates a BoundaryPolyCurve2D from the specified set of curves.BoundaryPolyCurve2D(int n)Creates a BoundaryPolyCurve2D by reserving space for n curves.BoundaryPolyCurve2D(T... curves)Creates a BoundaryPolyCurve2D from the specified set of curves.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.util.Collection<BoundaryPolyCurve2D<T>>continuousCurves()Returns a collection of PolyCurve2D that contains only this instance.static <T extends ContinuousOrientedCurve2D>
BoundaryPolyCurve2D<T>create(T... curves)Static factory for creating a new BoundaryPolyCurve2D from an array of curves.Domain2Ddomain()Returns the domain delimited by this boundary.voidfill(java.awt.Graphics2D g2)Fills the interior of the boundary, using the Graphics current Paint.booleanisClosed()Overrides the isClosed() in the following way: return true if all curves are bounded.BoundaryPolyCurve2D<? extends ContinuousOrientedCurve2D>reverse()Returns the reverse curve of this PolyCurve2D.BoundaryPolyCurve2D<ContinuousOrientedCurve2D>transform(AffineTransform2D trans)Transforms each smooth piece in this PolyCurve2D and returns a new instance of PolyCurve2D.-
Methods inherited from class math.geom2d.domain.PolyOrientedCurve2D
clip, create, createClosed, equals, isInside, signedDistance, signedDistance, subCurve, windingAngle
-
Methods inherited from class math.geom2d.curve.PolyCurve2D
appendPath, asPolyline, create, curvature, draw, getGeneralPath, leftTangent, rightTangent, setClosed, smoothPieces
-
Methods inherited from class math.geom2d.curve.CurveArray2D
add, add, almostEquals, asAwtShape, boundingBox, childCurve, clear, clone, contains, contains, contains, create, curveIndex, curves, distance, distance, firstCurve, firstPoint, get, getT0, getT1, globalPosition, indexOf, intersections, isBounded, isEmpty, isSingular, iterator, lastCurve, lastPoint, localPosition, point, position, project, remove, remove, singularPoints, size, t0, t1, vertices
-
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface math.geom2d.domain.Boundary2D
isInside
-
Methods inherited from interface math.geom2d.domain.ContinuousOrientedCurve2D
clip, subCurve
-
Methods inherited from interface math.geom2d.curve.ContinuousCurve2D
appendPath, asPolyline, curvature, leftTangent, rightTangent, smoothPieces
-
Methods inherited from interface math.geom2d.domain.OrientedCurve2D
signedDistance, signedDistance, windingAngle
-
Methods inherited from interface math.geom2d.curve.Curve2D
asAwtShape, clone, draw, firstPoint, getT0, getT1, intersections, isSingular, lastPoint, point, position, project, singularPoints, t0, t1, vertices
-
Methods inherited from interface math.geom2d.Shape2D
boundingBox, contains, contains, distance, distance, isBounded, isEmpty
-
Methods inherited from interface math.geom2d.GeometricObject2D
almostEquals
-
-
-
-
Constructor Detail
-
BoundaryPolyCurve2D
public BoundaryPolyCurve2D()
Creates an empty BoundaryPolyCurve2D.
-
BoundaryPolyCurve2D
public BoundaryPolyCurve2D(int n)
Creates a BoundaryPolyCurve2D by reserving space for n curves.- Parameters:
n- the number of curves to store
-
BoundaryPolyCurve2D
public BoundaryPolyCurve2D(T... curves)
Creates a BoundaryPolyCurve2D from the specified set of curves.
-
BoundaryPolyCurve2D
public BoundaryPolyCurve2D(java.util.Collection<? extends T> curves)
Creates a BoundaryPolyCurve2D from the specified set of curves.
-
-
Method Detail
-
create
public static <T extends ContinuousOrientedCurve2D> BoundaryPolyCurve2D<T> create(T... curves)
Static factory for creating a new BoundaryPolyCurve2D from an array of curves.- Since:
- 0.8.1
-
isClosed
public boolean isClosed()
Overrides the isClosed() in the following way: return true if all curves are bounded. If at least one curve is unbounded, return false.- Specified by:
isClosedin interfaceContinuousCurve2D- Overrides:
isClosedin classPolyCurve2D<T extends ContinuousOrientedCurve2D>
-
continuousCurves
public java.util.Collection<BoundaryPolyCurve2D<T>> continuousCurves()
Description copied from class:PolyCurve2DReturns a collection of PolyCurve2D that contains only this instance.- Specified by:
continuousCurvesin interfaceCurve2D- Specified by:
continuousCurvesin interfaceBoundary2D- Overrides:
continuousCurvesin classPolyCurve2D<T extends ContinuousOrientedCurve2D>- Returns:
- a collection of continuous curves.
-
domain
public Domain2D domain()
Description copied from interface:Boundary2DReturns the domain delimited by this boundary.- Specified by:
domainin interfaceBoundary2D- Returns:
- the domain delimited by this boundary
-
fill
public void fill(java.awt.Graphics2D g2)
Description copied from interface:Boundary2DFills the interior of the boundary, using the Graphics current Paint.- Specified by:
fillin interfaceBoundary2D- Parameters:
g2- the Graphics to fill on
-
reverse
public BoundaryPolyCurve2D<? extends ContinuousOrientedCurve2D> reverse()
Description copied from class:PolyCurve2DReturns the reverse curve of this PolyCurve2D.- Specified by:
reversein interfaceContinuousCurve2D- Specified by:
reversein interfaceCurve2D- Specified by:
reversein interfaceBoundary2D- Specified by:
reversein interfaceContinuousOrientedCurve2D- Specified by:
reversein interfaceContour2D- Specified by:
reversein interfaceOrientedCurve2D- Overrides:
reversein classPolyOrientedCurve2D<T extends ContinuousOrientedCurve2D>
-
transform
public BoundaryPolyCurve2D<ContinuousOrientedCurve2D> transform(AffineTransform2D trans)
Description copied from class:PolyCurve2DTransforms each smooth piece in this PolyCurve2D and returns a new instance of PolyCurve2D.- Specified by:
transformin interfaceContinuousCurve2D- Specified by:
transformin interfaceCurve2D- Specified by:
transformin interfaceCurveSet2D<T extends ContinuousOrientedCurve2D>- Specified by:
transformin interfaceBoundary2D- Specified by:
transformin interfaceContinuousOrientedCurve2D- Specified by:
transformin interfaceContour2D- Specified by:
transformin interfaceOrientedCurve2D- Specified by:
transformin interfaceShape2D- Overrides:
transformin classPolyOrientedCurve2D<T extends ContinuousOrientedCurve2D>- Parameters:
trans- an affine transform- Returns:
- the transformed shape
-
-
DMelt 3.0 © DataMelt by jWork.ORG