math.geom2d.domain
Class ContourArray2D<T extends Contour2D>
- java.lang.Object
-
- math.geom2d.curve.CurveArray2D<T>
-
- math.geom2d.domain.ContourArray2D<T>
-
- All Implemented Interfaces:
- java.lang.Cloneable, java.lang.Iterable<T>, Curve2D, CurveSet2D<T>, Boundary2D, OrientedCurve2D, GeometricObject2D, Shape2D, ShapeSet2D<T>
- Direct Known Subclasses:
- CirculinearContourArray2D, Hyperbola2D
public class ContourArray2D<T extends Contour2D> extends CurveArray2D<T> implements Boundary2D
A ContourArray2D is a set of contours. Each contour in the set defines its own domain.
-
-
Constructor Summary
Constructors Constructor and Description ContourArray2D()ContourArray2D(java.util.Collection<? extends T> curves)ContourArray2D(int size)ContourArray2D(T... curves)ContourArray2D(T curve)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description CurveSet2D<? extends ContinuousOrientedCurve2D>clip(Box2D box)Clip the curve by a box.java.util.Collection<? extends T>continuousCurves()Returns the collection of continuous curves which constitute this curve.static <T extends Contour2D>
ContourArray2D<T>create(T... curves)Static factory for creating a new ContourArray2D from an array of contours.Domain2Ddomain()Returns the domain delimited by this boundary.booleanequals(java.lang.Object obj)Returns true if obj is a CurveArray2D with the same number of curves, and such that each curve belongs to both objects.voidfill(java.awt.Graphics2D g2)Fills the interior of the boundary, using the Graphics current Paint.booleanisInside(Point2D point)Returns true if the point is 'inside' the domain bounded by the curve.ContourArray2D<? extends Contour2D>reverse()Returns the curve with same trace on the plane with parameterization in reverse order.doublesignedDistance(double x, double y)The same as distanceSigned(Point2D), but by passing 2 double as arguments.doublesignedDistance(Point2D p)Returns the signed distance of the curve to the given point.CurveSet2D<? extends ContinuousOrientedCurve2D>subCurve(double t0, double t1)Return an instance of CurveArray2D.ContourArray2D<? extends Contour2D>transform(AffineTransform2D trans)Transforms each curve, and build a new CurveArray2D with the set of transformed curves.doublewindingAngle(Point2D point)Return the angle portion that the curve turn around the given point.-
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.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
-
ContourArray2D
public ContourArray2D()
-
ContourArray2D
public ContourArray2D(int size)
-
ContourArray2D
public ContourArray2D(T... curves)
-
ContourArray2D
public ContourArray2D(java.util.Collection<? extends T> curves)
-
ContourArray2D
public ContourArray2D(T curve)
-
-
Method Detail
-
create
public static <T extends Contour2D> ContourArray2D<T> create(T... curves)
Static factory for creating a new ContourArray2D from an array of contours.- Since:
- 0.8.1
-
continuousCurves
public java.util.Collection<? extends T> continuousCurves()
Description copied from interface:Curve2DReturns the collection of continuous curves which constitute this curve.- Specified by:
continuousCurvesin interfaceCurve2D- Specified by:
continuousCurvesin interfaceBoundary2D- Overrides:
continuousCurvesin classCurveArray2D<T extends Contour2D>- 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
-
windingAngle
public double windingAngle(Point2D point)
Description copied from interface:OrientedCurve2DReturn the angle portion that the curve turn around the given point. Result is a signed angle.- Specified by:
windingAnglein interfaceOrientedCurve2D- Parameters:
point- a point of the plane- Returns:
- a signed angle
-
signedDistance
public double signedDistance(Point2D p)
Description copied from interface:OrientedCurve2DReturns the signed distance of the curve to the given point. The distance is positive if the point lies outside the shape, and negative if the point lies inside the shape. In both cases, absolute value of distance is equals to the distance to the border of the shape.- Specified by:
signedDistancein interfaceOrientedCurve2D- Parameters:
p- a point of the plane- Returns:
- the signed distance to the curve
-
signedDistance
public double signedDistance(double x, double y)Description copied from interface:OrientedCurve2DThe same as distanceSigned(Point2D), but by passing 2 double as arguments.- Specified by:
signedDistancein interfaceOrientedCurve2D- Parameters:
x- x-coord of a pointy- y-coord of a point- Returns:
- the signed distance of the point (x,y) to the curve
-
isInside
public boolean isInside(Point2D point)
Description copied from interface:Boundary2DReturns true if the point is 'inside' the domain bounded by the curve.- Specified by:
isInsidein interfaceBoundary2D- Specified by:
isInsidein interfaceOrientedCurve2D- Parameters:
point- a point in the plane- Returns:
- true if the point is on the left side of the curve.
-
reverse
public ContourArray2D<? extends Contour2D> reverse()
Description copied from interface:Curve2DReturns the curve with same trace on the plane with parameterization in reverse order.- Specified by:
reversein interfaceCurve2D- Specified by:
reversein interfaceBoundary2D- Specified by:
reversein interfaceOrientedCurve2D- Overrides:
reversein classCurveArray2D<T extends Contour2D>
-
subCurve
public CurveSet2D<? extends ContinuousOrientedCurve2D> subCurve(double t0, double t1)
Description copied from class:CurveArray2DReturn an instance of CurveArray2D.
-
clip
public CurveSet2D<? extends ContinuousOrientedCurve2D> clip(Box2D box)
Clip 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 interfaceCurve2D- Specified by:
clipin interfaceOrientedCurve2D- Specified by:
clipin interfaceShape2D- Overrides:
clipin classCurveArray2D<T extends Contour2D>- Parameters:
box- the clipping box- Returns:
- the clipped shape
-
transform
public ContourArray2D<? extends Contour2D> transform(AffineTransform2D trans)
Description copied from class:CurveArray2DTransforms each curve, and build a new CurveArray2D with the set of transformed curves.- Specified by:
transformin interfaceCurve2D- Specified by:
transformin interfaceCurveSet2D<T extends Contour2D>- Specified by:
transformin interfaceBoundary2D- Specified by:
transformin interfaceOrientedCurve2D- Specified by:
transformin interfaceShape2D- Overrides:
transformin classCurveArray2D<T extends Contour2D>- Parameters:
trans- an affine transform- Returns:
- the transformed shape
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:CurveArray2DReturns true if obj is a CurveArray2D with the same number of curves, and such that each curve belongs to both objects.- Overrides:
equalsin classCurveArray2D<T extends Contour2D>
-
-
DMelt 3.0 © DataMelt by jWork.ORG