|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Shape2D
Main interface for all geometric objects, including points, lines, curves, or planar regions... Instances of Shape2D can be either bounded (a point, a line segment, a square...) or unbounded (a parabola, a half-plane...).
Shape2D implementations implements a more specialized interface depending
on the shape inner dimension:
Curve2D
,
Domain2D
or
PointShape2D
.
Shape2D interface provide convenient method to check if the shape
is empty
, to transform
or to clip
the shape, get its
bounding box
, or its
distance
to a given point.
Field Summary | |
---|---|
static double |
ACCURACY
The constant used for testing results. |
Method Summary | |
---|---|
Box2D |
boundingBox()
Returns the bounding box of the shape. |
Shape2D |
clip(Box2D box)
Clip the shape with the given box, and returns a new shape. |
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. |
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 shape on the given graphics. |
boolean |
isBounded()
Returns true if the shape is bounded, that is if we can draw a finite rectangle enclosing the shape. |
boolean |
isEmpty()
Returns true if the shape does not contain any point. |
Shape2D |
transform(AffineTransform2D trans)
Transforms the shape by an affine transform. |
Methods inherited from interface math.geom2d.GeometricObject2D |
---|
almostEquals |
Field Detail |
---|
static final double ACCURACY
Method Detail |
---|
boolean contains(double x, double y)
boolean contains(Point2D p)
double distance(Point2D p)
double distance(double x, double y)
boolean isBounded()
boolean isEmpty()
Box2D boundingBox()
Shape2D clip(Box2D box)
box
- the clipping box
Shape2D transform(AffineTransform2D trans)
trans
- an affine transform
void draw(java.awt.Graphics2D g2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |