math.geom2d.conic
Class Disc2D

java.lang.Object
  extended by math.geom2d.conic.Disc2D
All Implemented Interfaces:
java.awt.Shape, Domain2D, Shape2D

public class Disc2D
extends java.lang.Object
implements Domain2D

A domain of the plane whose boundary is a circle.

Author:
Legland

Field Summary
protected  Circle2D circle
           
 
Fields inherited from interface math.geom2d.Shape2D
ACCURACY, defaultClipWindow, EMPTY_SET
 
Constructor Summary
Disc2D()
           
Disc2D(Circle2D circle)
           
Disc2D(Point2D p, double r)
           
 
Method Summary
 Shape2D clip(Box2D box)
          Clip the shape with the given box, and returns a new shape.
 boolean contains(double x, double y)
           
 boolean contains(double x, double y, double w, double h)
           
 boolean contains(java.awt.geom.Point2D p)
           
 boolean contains(java.awt.geom.Rectangle2D rect)
           
 Boundary2D getBoundary()
          returns the boundary of the set.
 Box2D getBoundingBox()
          Returns the bounding box of the shape.
 java.awt.Rectangle getBounds()
          Return bounding box of the shape.
 java.awt.geom.Rectangle2D getBounds2D()
          Return more precise bounds for the shape.
 Shape2D getClippedShape(Box2D 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. 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.
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform trans)
           
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform trans, double flatness)
           
 boolean intersects(double x, double y, double w, double h)
           
 boolean intersects(java.awt.geom.Rectangle2D rect)
           
 boolean isBounded()
          return always true.
 Shape2D transform(AffineTransform2D trans)
          transform the shape by an affine transform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

circle

protected Circle2D circle
Constructor Detail

Disc2D

public Disc2D()

Disc2D

public Disc2D(Circle2D circle)

Disc2D

public Disc2D(Point2D p,
              double r)
Method Detail

getBoundary

public Boundary2D getBoundary()
Description copied from interface: Domain2D
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.

Specified by:
getBoundary in interface Domain2D
Returns:
the boundary of the domain

getDistance

public double getDistance(java.awt.geom.Point2D p)
Description copied from interface: Shape2D
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.

Specified by:
getDistance in interface Shape2D

getDistance

public double getDistance(double x,
                          double y)
Description copied from interface: Shape2D
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.

Specified by:
getDistance in interface Shape2D

isBounded

public boolean isBounded()
return always true.

Specified by:
isBounded in interface Shape2D

getClippedShape

public Shape2D getClippedShape(Box2D box)

clip

public Shape2D clip(Box2D box)
Description copied from interface: Shape2D
Clip the shape with the given box, and returns a new shape.

Specified by:
clip in interface Shape2D
Parameters:
box - the clipping box
Returns:
the clipped shape

getBoundingBox

public Box2D getBoundingBox()
Description copied from interface: Shape2D
Returns the bounding box of the shape.

Specified by:
getBoundingBox in interface Shape2D
Returns:
the bounding box of the shape.

transform

public Shape2D transform(AffineTransform2D trans)
Description copied from interface: Shape2D
transform the shape by an affine transform. Subclasses may override the type of returned shape.

Specified by:
transform in interface Shape2D
Parameters:
trans - an affine transform
Returns:
the transformed shape

contains

public boolean contains(double x,
                        double y)
Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(java.awt.geom.Point2D p)
Specified by:
contains in interface java.awt.Shape

getBounds

public java.awt.Rectangle getBounds()
Return bounding box of the shape.

Specified by:
getBounds in interface java.awt.Shape

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D()
Return more precise bounds for the shape.

Specified by:
getBounds2D in interface java.awt.Shape

contains

public boolean contains(java.awt.geom.Rectangle2D rect)
Specified by:
contains in interface java.awt.Shape

intersects

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Specified by:
intersects in interface java.awt.Shape

intersects

public boolean intersects(java.awt.geom.Rectangle2D rect)
Specified by:
intersects in interface java.awt.Shape

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform trans)
Specified by:
getPathIterator in interface java.awt.Shape

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform trans,
                                                  double flatness)
Specified by:
getPathIterator in interface java.awt.Shape