math.geom2d
Interface Shape2D

All Superinterfaces:
java.awt.Shape
All Known Subinterfaces:
Boundary2D, Conic2D, ContinuousBoundary2D, ContinuousCurve2D, ContinuousOrientedCurve2D, Curve2D, Domain2D, OrientedCurve2D, PolygonalShape2D, SmoothCurve2D, SmoothOrientedCurve2D
All Known Implementing Classes:
BezierCurve2D, BoundaryPolyCurve2D, BoundarySet2D, Box2D, Circle2D, CircleArc2D, ClosedPolyline2D, CurveSet2D, Disc2D, Ellipse2D, EllipseArc2D, GenericDomain2D, HalfPlane2D, HRectangle2D, Hyperbola2D, HyperbolaBranch2D, HyperbolaBranchArc2D, LineArc2D, LineObject2D, LineSegment2D, MultiPolygon2D, Parabola2D, ParabolaArc2D, ParametricConic2D, Point2D, PointSet2D, PolyBezierCurve2D, PolyCurve2D, Polygon2D, Polyline2D, PolyOrientedCurve2D, Ray2D, Rectangle2D, StraightLine2D, StraightObject2D

public interface Shape2D
extends java.awt.Shape

Main interface for all geometric objects, including points, lines, curves, or planar regions...

Depending direct interfaces extending Shape2D are Curve2D, and AbstractDomain2D. There are some direct implementation of Shape2D: Point2D, Shape2D.EmptySet2D.


Field Summary
static double ACCURACY
          The constant used for testing results.
static Box2D defaultClipWindow
          This is the basic window used by default to clip lines, conics or others infinite figures to draw them.
static Shape2D EMPTY_SET
           
 
Method Summary
 Shape2D clip(Box2D box)
          Clip the shape with the given box, and returns a new shape.
 Box2D getBoundingBox()
          Returns the bounding box of the shape.
 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. fillable) shape.
 double getDistance(java.awt.geom.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 shape is bounded, that is if we can draw a finite rectangle enclosing the shape.
 Shape2D transform(AffineTransform2D trans)
          transform the shape by an affine transform.
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, intersects, intersects
 

Field Detail

ACCURACY

static final double ACCURACY
The constant used for testing results.

See Also:
Constant Field Values

defaultClipWindow

static final Box2D defaultClipWindow
This is the basic window used by default to clip lines, conics or others infinite figures to draw them. To override this default window, use Shape2D.getClippedShape(Rectangle2D), which always returns a 'finite' shape.


EMPTY_SET

static final Shape2D EMPTY_SET
Method Detail

getDistance

double getDistance(java.awt.geom.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.


getDistance

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. fillable) shape.


isBounded

boolean isBounded()
Returns true if the shape is bounded, that is if we can draw a finite rectangle enclosing the shape. For example, a straight line or a parabola are not bounded.


clip

Shape2D clip(Box2D box)
Clip the shape with the given box, and returns a new shape.

Parameters:
box - the clipping box
Returns:
the clipped shape

getBoundingBox

Box2D getBoundingBox()
Returns the bounding box of the shape.

Returns:
the bounding box of the shape.

transform

Shape2D transform(AffineTransform2D trans)
transform the shape by an affine transform. Subclasses may override the type of returned shape.

Parameters:
trans - an affine transform
Returns:
the transformed shape