math.geom2d.domain
Interface Domain2D
-
- All Superinterfaces:
- GeometricObject2D, Shape2D
- All Known Subinterfaces:
- CirculinearDomain2D, DomainSet2D<T>, Polygon2D
- All Known Implementing Classes:
- DomainArray2D, GenericCirculinearDomain2D, GenericDomain2D, HRectangle2D, MultiPolygon2D, Rectangle2D, SimplePolygon2D
public interface Domain2D extends Shape2D
Interface for shapes that draws an 'interior' and an 'exterior'. An AbstractDomain2D can be defined with a non-self intersecting set of Curve2D, and contains all points lying 'on the left' of the parent curve.Some Shape may seem very similar, for example Conic2D and ConicCurve2D. The reason is that a point can be contained in a Conic2D but not in the ConicCurve2D.
-
-
Method Summary
All Methods Instance Methods Abstract 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.Domain2Dcomplement()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.voiddraw(java.awt.Graphics2D g2)Draws the boundary of the domain, using current Stroke and color.voidfill(java.awt.Graphics2D g2)Fills the interior of the domain, using the Graphics current Paint.Domain2Dtransform(AffineTransform2D transform)Transforms the shape by an affine transform.-
Methods inherited from interface math.geom2d.Shape2D
boundingBox, contains, contains, distance, distance, isBounded, isEmpty
-
Methods inherited from interface math.geom2d.GeometricObject2D
almostEquals
-
-
-
-
Method Detail
-
boundary
Boundary2D boundary()
Returns 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.
- Returns:
- the boundary of the domain
-
contours
java.util.Collection<? extends Contour2D> contours()
Returns the set of contours that enclose this domain. The result is a collection of shapes that implement the Contour2D interface.- See Also:
Contour2D
-
complement
Domain2D complement()
Returns the domain which complements this domain in the plane.- Returns:
- the complement of this domain.
- Since:
- 0.6.3
-
asPolygon
Polygon2D asPolygon(int n)
Returns an approximation of the domain as a polygon, or a MultiPolygon.- Returns:
- a polygon
- Since:
- 0.10.2
-
transform
Domain2D transform(AffineTransform2D transform)
Description copied from interface:Shape2DTransforms the shape by an affine transform. Subclasses may override the type of returned shape.
-
clip
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.
-
draw
void draw(java.awt.Graphics2D g2)
Draws the boundary of the domain, using current Stroke and color.
-
fill
void fill(java.awt.Graphics2D g2)
Fills the interior of the domain, using the Graphics current Paint.- Parameters:
g2- the Graphics to fill on- Since:
- 0.6.3
-
-
DMelt 3.0 © DataMelt by jWork.ORG