|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmath.geom2d.domain.GenericDomain2D
public class GenericDomain2D
A domain defined from its boundary. The boundary curve must be correctly oriented, non self intersecting, and clearly separating interior and exterior.
All contains and intersect tests are computed from the signed distance of the boundary curve.
| Field Summary |
|---|
| Fields inherited from interface math.geom2d.Shape2D |
|---|
ACCURACY |
| Constructor Summary | |
|---|---|
GenericDomain2D(Boundary2D boundary)
|
|
| Method Summary | |
|---|---|
boolean |
almostEquals(GeometricObject2D obj,
double eps)
Checks if the two objects are similar up to a given threshold value. |
Polygon2D |
asPolygon(int n)
Returns an approximation of the domain as a polygon, or a MultiPolygon. |
Boundary2D |
boundary()
Returns the boundary of the set. |
Box2D |
boundingBox()
If the domain is bounded, returns the bounding box of its boundary, otherwise returns an infinite bounding box. |
Domain2D |
clip(Box2D box)
Clip the shape with the given box, and returns a new shape. |
Domain2D |
complement()
Returns the domain which complements this domain in the plane. |
boolean |
contains(double x,
double y)
Checks if the shape contains the planar point defined by (x,y). |
boolean |
contains(Point2D p)
Checks if the shape contains the given point. |
java.util.Collection<? extends Contour2D> |
contours()
Returns the set of contours that enclose this domain. |
static GenericDomain2D |
create(Boundary2D boundary)
|
double |
distance(double x,
double y)
Returns the distance of the shape to the given point, specified by x and y, or the distance of point to the frontier of the shape in the case of a plain (i.e. fillable) shape. |
double |
distance(Point2D p)
Returns the distance of the shape to the given point, or the distance of point to the frontier of the shape in the case of a plain shape. |
void |
draw(java.awt.Graphics2D g2)
Draws the boundary of the domain, using current Stroke and color. |
boolean |
equals(java.lang.Object obj)
|
void |
fill(java.awt.Graphics2D g2)
Fills the interior of the domain, using the Graphics current Paint. |
boolean |
isBounded()
Returns true if the domain is bounded. |
boolean |
isEmpty()
Returns true if the shape does not contain any point. |
java.lang.String |
toString()
|
GenericDomain2D |
transform(AffineTransform2D trans)
Returns a new domain which is created from the transformed domain of this boundary. |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GenericDomain2D(Boundary2D boundary)
| Method Detail |
|---|
public static GenericDomain2D create(Boundary2D boundary)
public Polygon2D asPolygon(int n)
Domain2D
asPolygon in interface Domain2Dpublic Boundary2D boundary()
Domain2DThe returned curve is oriented, with an interior and an exterior.
boundary in interface Domain2Dpublic java.util.Collection<? extends Contour2D> contours()
Domain2D
contours in interface Domain2DContour2Dpublic Domain2D complement()
Domain2D
complement in interface Domain2Dpublic double distance(Point2D p)
Shape2D
distance in interface Shape2D
public double distance(double x,
double y)
Shape2D
distance in interface Shape2Dpublic boolean isBounded()
isBounded in interface Shape2Dpublic boolean isEmpty()
Shape2D
isEmpty in interface Shape2Dpublic Domain2D clip(Box2D box)
Shape2D
clip in interface Domain2Dclip in interface Shape2Dbox - the clipping box
public Box2D boundingBox()
boundingBox in interface Shape2Dpublic GenericDomain2D transform(AffineTransform2D trans)
transform in interface Domain2Dtransform in interface Shape2Dtrans - an affine transform
public boolean contains(double x,
double y)
Shape2D
contains in interface Shape2Dpublic boolean contains(Point2D p)
Shape2D
contains in interface Shape2Dpublic void draw(java.awt.Graphics2D g2)
Domain2D
draw in interface Domain2Ddraw in interface Shape2Dg2 - the Graphics to draw onpublic void fill(java.awt.Graphics2D g2)
Domain2D
fill in interface Domain2Dg2 - the Graphics to fill on
public boolean almostEquals(GeometricObject2D obj,
double eps)
GeometricObject2D
almostEquals in interface GeometricObject2Dobj - the object to compareeps - a threshold value, for example the minimal coordinate difference
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||