math.geom2d.circulinear
Class CirculinearContourArray2D<T extends CirculinearContour2D>
- java.lang.Object
-
- math.geom2d.curve.CurveArray2D<T>
-
- math.geom2d.domain.ContourArray2D<T>
-
- math.geom2d.circulinear.CirculinearContourArray2D<T>
-
- All Implemented Interfaces:
- java.lang.Cloneable, java.lang.Iterable<T>, CirculinearBoundary2D, CirculinearCurve2D, CirculinearShape2D, Curve2D, CurveSet2D<T>, Boundary2D, OrientedCurve2D, GeometricObject2D, Shape2D, ShapeSet2D<T>
public class CirculinearContourArray2D<T extends CirculinearContour2D> extends ContourArray2D<T> implements CirculinearBoundary2D
A circulinear boundary which is composed of several CirculinearContour2D.Creates an array of circular contours:
Circle2D circle1 = new Circle2D(new Point2D(0, 100), 30); Circle2D circle2 = new Circle2D(new Point2D(0, 100), 30); CirculinearContourArray2Darray = CirculinearContourArray2D.create(new Circle2D[]{circle1, circle2});
-
-
Constructor Summary
Constructors Constructor and Description CirculinearContourArray2D()Empty constructor.CirculinearContourArray2D(java.util.Collection<? extends T> curves)Constructor from a collection of curves.CirculinearContourArray2D(int n)Empty constructor.CirculinearContourArray2D(T... curves)Constructor from an array of curves.CirculinearContourArray2D(T curve)Constructor from a single curve.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description CirculinearDomain2Dbuffer(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.CirculinearCurveSet2D<? extends CirculinearContinuousCurve2D>clip(Box2D box)Clip the curve by a box.java.util.Collection<T>continuousCurves()Returns the collection of continuous curves which constitute this curve.static <T extends CirculinearContour2D>
CirculinearContourArray2D<T>create(T... curves)Static factory for creating a new CirculinearContourArray2D from an array of curves.CirculinearDomain2Ddomain()Returns the domain delimited by this boundary.doublelength()doublelength(double pos)CirculinearBoundary2Dparallel(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.doubleposition(double length)CirculinearContourArray2D<? extends CirculinearContour2D>reverse()Returns the curve with same trace on the plane with parameterization in reverse order.CirculinearCurveSet2D<? extends CirculinearContinuousCurve2D>subCurve(double t0, double t1)Return an instance of CurveArray2D.CirculinearContourArray2D<? extends CirculinearContour2D>transform(CircleInversion2D inv)Transforms the shape by a circle inversion.-
Methods inherited from class math.geom2d.domain.ContourArray2D
equals, fill, isInside, signedDistance, signedDistance, transform, windingAngle
-
Methods inherited from class math.geom2d.curve.CurveArray2D
add, add, almostEquals, asAwtShape, boundingBox, childCurve, clear, clone, contains, contains, contains, create, curveIndex, curves, distance, distance, draw, firstCurve, firstPoint, get, getGeneralPath, 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
fill, isInside, transform
-
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
-
CirculinearContourArray2D
public CirculinearContourArray2D()
Empty constructor. Initializes an empty array of curves.
-
CirculinearContourArray2D
public CirculinearContourArray2D(int n)
Empty constructor. Initializes an empty array of curves, with a given size for allocating memory.
-
CirculinearContourArray2D
public CirculinearContourArray2D(T... curves)
Constructor from an array of curves.- Parameters:
curves- the array of curves in the set
-
CirculinearContourArray2D
public CirculinearContourArray2D(T curve)
Constructor from a single curve.- Parameters:
curve- the initial contour contained in the array
-
CirculinearContourArray2D
public CirculinearContourArray2D(java.util.Collection<? extends T> curves)
Constructor from a collection of curves. The curves are added to the inner collection of curves.- Parameters:
curves- the collection of curves to add to the set
-
-
Method Detail
-
create
public static <T extends CirculinearContour2D> CirculinearContourArray2D<T> create(T... curves)
Static factory for creating a new CirculinearContourArray2D from an array of curves.- Since:
- 0.8.1
-
domain
public CirculinearDomain2D domain()
Description copied from interface:Boundary2DReturns the domain delimited by this boundary.- Specified by:
domainin interfaceCirculinearBoundary2D- Specified by:
domainin interfaceBoundary2D- Overrides:
domainin classContourArray2D<T extends CirculinearContour2D>- Returns:
- the domain delimited by this boundary
-
length
public double length()
- Specified by:
lengthin interfaceCirculinearCurve2D- Returns:
- the length of the curve
-
length
public double length(double pos)
- Specified by:
lengthin interfaceCirculinearCurve2D- Returns:
- the length from the beginning to the position given by pos
-
position
public double position(double length)
- Specified by:
positionin interfaceCirculinearCurve2D- Returns:
- the position located at a given geodesic distance from the origin
-
buffer
public CirculinearDomain2D buffer(double dist)
Description copied from interface:CirculinearShape2DComputes 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.- Specified by:
bufferin interfaceCirculinearShape2D- Parameters:
dist- the maximal distance between a point of the buffer and the shape- Returns:
- the buffer of the shape
-
parallel
public CirculinearBoundary2D parallel(double d)
Description copied from interface:CirculinearCurve2DCreates 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.- Specified by:
parallelin interfaceCirculinearBoundary2D- Specified by:
parallelin interfaceCirculinearCurve2D- Parameters:
d- the distance between the original curve and he parallel curve.- Returns:
- the parallel curve
-
transform
public CirculinearContourArray2D<? extends CirculinearContour2D> transform(CircleInversion2D inv)
Description copied from interface:CirculinearShape2DTransforms the shape by a circle inversion. The result is still an instance a CirculinearShape2D.- Specified by:
transformin interfaceCirculinearBoundary2D- Specified by:
transformin interfaceCirculinearCurve2D- Specified by:
transformin interfaceCirculinearShape2D- Parameters:
inv- the circle inversion- Returns:
- the transformed shape
-
continuousCurves
public java.util.Collection<T> continuousCurves()
Description copied from interface:Curve2DReturns the collection of continuous curves which constitute this curve.- Specified by:
continuousCurvesin interfaceCirculinearBoundary2D- Specified by:
continuousCurvesin interfaceCirculinearCurve2D- Specified by:
continuousCurvesin interfaceCurve2D- Specified by:
continuousCurvesin interfaceBoundary2D- Overrides:
continuousCurvesin classContourArray2D<T extends CirculinearContour2D>- Returns:
- a collection of continuous curves.
-
clip
public CirculinearCurveSet2D<? extends CirculinearContinuousCurve2D> clip(Box2D box)
Description copied from class:ContourArray2DClip the curve by a box. The result is an instance of CurveSet2D, which contains only instances of ContinuousOrientedCurve2D. If the curve is not clipped, the result is an instance of CurveSet2D which contains 0 curves. - Specified by:
clipin interfaceCirculinearBoundary2D- Specified by:
clipin interfaceCirculinearCurve2D- Specified by:
clipin interfaceCurve2D- Specified by:
clipin interfaceOrientedCurve2D- Specified by:
clipin interfaceShape2D- Overrides:
clipin classContourArray2D<T extends CirculinearContour2D>- Parameters:
box- the clipping box- Returns:
- the clipped shape
-
reverse
public CirculinearContourArray2D<? extends CirculinearContour2D> reverse()
Description copied from interface:Curve2DReturns the curve with same trace on the plane with parameterization in reverse order.- Specified by:
reversein interfaceCirculinearBoundary2D- Specified by:
reversein interfaceCirculinearCurve2D- Specified by:
reversein interfaceCurve2D- Specified by:
reversein interfaceBoundary2D- Specified by:
reversein interfaceOrientedCurve2D- Overrides:
reversein classContourArray2D<T extends CirculinearContour2D>
-
subCurve
public CirculinearCurveSet2D<? extends CirculinearContinuousCurve2D> subCurve(double t0, double t1)
Description copied from class:CurveArray2DReturn an instance of CurveArray2D.- Specified by:
subCurvein interfaceCirculinearCurve2D- Specified by:
subCurvein interfaceCurve2D- Overrides:
subCurvein classContourArray2D<T extends CirculinearContour2D>- Parameters:
t0- position of the start of the sub-curvet1- position of the end of the sub-curve- Returns:
- the portion of original curve comprised between t0 and t1.
-
-
DMelt 3.0 © DataMelt by jWork.ORG