public class GenericDomain2D extends Object implements Domain2D
All contains and intersect tests are computed from the signed distance of the boundary curve.
| Modifier and Type | Field and Description |
|---|---|
protected Boundary2D |
boundary |
| Constructor and Description |
|---|
GenericDomain2D(Boundary2D boundary) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
draw(Graphics2D g2)
Draws the boundary of the domain, using current Stroke and color.
|
void |
fill(Graphics2D g2)
Fills the interior of the domain, using the Graphics current Paint.
|
Boundary2D |
getBoundary()
Returns the boundary of the set.
|
Box2D |
getBoundingBox()
If the domain is bounded, returns the bounding box of its boundary,
otherwise returns an infinite bounding box.
|
double |
getDistance(double x,
double y)
get 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.
|
double |
getDistance(Point2D p)
get 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.
|
boolean |
isBounded()
Returns true if the domain is bounded.
|
boolean |
isEmpty()
Returns true if the shape does not contain any point.
|
GenericDomain2D |
transform(AffineTransform2D trans)
Returns a new domain which is created from the transformed domain of this
boundary.
|
protected Boundary2D boundary
public GenericDomain2D(Boundary2D boundary)
public Boundary2D getBoundary()
Domain2DThe returned curve is oriented, with an interior and an exterior.
getBoundary in interface Domain2Dpublic Domain2D complement()
Domain2Dcomplement in interface Domain2Dpublic double getDistance(Point2D p)
Shape2DgetDistance in interface Shape2Dpublic double getDistance(double x,
double y)
Shape2DgetDistance in interface Shape2Dpublic boolean isBounded()
public boolean isEmpty()
Shape2Dpublic Domain2D clip(Box2D box)
Shape2Dpublic Box2D getBoundingBox()
getBoundingBox in interface Shape2Dpublic GenericDomain2D transform(AffineTransform2D trans)
public boolean contains(double x,
double y)
Shape2Dpublic boolean contains(Point2D p)
Shape2Dpublic void draw(Graphics2D g2)
Domain2Dpublic void fill(Graphics2D g2)
Domain2DCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.