math.geom2d.domain
Class DomainArray2D<T extends Domain2D>
- java.lang.Object
-
- math.geom2d.ShapeArray2D<T>
-
- math.geom2d.domain.DomainArray2D<T>
-
- All Implemented Interfaces:
- java.lang.Cloneable, java.lang.Iterable<T>, Domain2D, DomainSet2D<T>, GeometricObject2D, Shape2D, ShapeSet2D<T>
public class DomainArray2D<T extends Domain2D> extends ShapeArray2D<T> implements DomainSet2D<T>
An array of domains. Note that this class if different from a generic domain whose boundary is a set of contours. In the latter case, the shape is itself a domain, not in the former.
-
-
Constructor Summary
Constructors Constructor and Description DomainArray2D()DomainArray2D(java.util.Collection<T> domains)DomainArray2D(int n)DomainArray2D(T... domains)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description Polygon2DasPolygon(int n)Returns an approximation of the domain as a polygon, or a MultiPolygon.Boundary2Dboundary()Returns the boundary of the set.Domain2Dclip(Box2D box)Clip the shape with the given box, and returns a new shape.DomainSet2D<? extends Domain2D>complement()Returns the domain which complements this domain in the plane.java.util.Collection<? extends Contour2D>contours()Returns the set of contours that enclose this domain.static <D extends Domain2D>
DomainArray2D<D>create(D... array)booleanequals(java.lang.Object obj)Returns true if obj is a CurveSet2D with the same number of shapes, and such that each shape belongs to both objects.voidfill(java.awt.Graphics2D g2)Fills the interior of the domain, using the Graphics current Paint.DomainArray2D<? extends Domain2D>transform(AffineTransform2D trans)Transforms the shape by an affine transform.-
Methods inherited from class math.geom2d.ShapeArray2D
add, add, almostEquals, boundingBox, clear, clone, contains, contains, contains, create, create, distance, distance, draw, get, indexOf, isBounded, isEmpty, iterator, remove, remove, shapes, size
-
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface math.geom2d.ShapeSet2D
add, add, clear, contains, get, indexOf, remove, remove, size
-
Methods inherited from interface math.geom2d.Shape2D
boundingBox, contains, contains, distance, distance, isBounded, isEmpty
-
Methods inherited from interface math.geom2d.GeometricObject2D
almostEquals
-
-
-
-
Constructor Detail
-
DomainArray2D
public DomainArray2D()
-
DomainArray2D
public DomainArray2D(int n)
- Parameters:
n-
-
DomainArray2D
public DomainArray2D(java.util.Collection<T> domains)
- Parameters:
domains- the initial set of domains that constitutes this array.
-
DomainArray2D
public DomainArray2D(T... domains)
- Parameters:
domains- the initial set of domains that constitutes this array.
-
-
Method Detail
-
create
public static <D extends Domain2D> DomainArray2D<D> create(D... array)
-
boundary
public Boundary2D boundary()
Description copied from interface:Domain2DReturns the boundary of the set. This boundary is either a continuous non intersecting curve (connected domain), or a set of non intersecting continuous curve (one continuous non-intersection for each connected part of the domain).The returned curve is oriented, with an interior and an exterior.
-
contours
public java.util.Collection<? extends Contour2D> contours()
Description copied from interface:Domain2DReturns the set of contours that enclose this domain. The result is a collection of shapes that implement the Contour2D interface.
-
complement
public DomainSet2D<? extends Domain2D> complement()
Description copied from interface:Domain2DReturns the domain which complements this domain in the plane.- Specified by:
complementin interfaceDomain2D- Returns:
- the complement of this domain.
-
asPolygon
public Polygon2D asPolygon(int n)
Description copied from interface:Domain2DReturns an approximation of the domain as a polygon, or a MultiPolygon.
-
fill
public void fill(java.awt.Graphics2D g2)
Description copied from interface:Domain2DFills the interior of the domain, using the Graphics current Paint.
-
transform
public DomainArray2D<? extends Domain2D> transform(AffineTransform2D trans)
Description copied from interface:Shape2DTransforms the shape by an affine transform. Subclasses may override the type of returned shape.
-
clip
public Domain2D clip(Box2D box)
Description copied from interface:Shape2DClip the shape with the given box, and returns a new shape. The box must be bounded.
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:ShapeArray2DReturns true if obj is a CurveSet2D with the same number of shapes, and such that each shape belongs to both objects.- Overrides:
equalsin classShapeArray2D<T extends Domain2D>
-
-
DMelt 3.0 © DataMelt by jWork.ORG