|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmath.geom2d.polygon.MultiPolygon2D
public class MultiPolygon2D
A polygonal domain whose boundary is composed of several disjoint continuous ClosedPolyline2D.
| Field Summary |
|---|
| Fields inherited from interface math.geom2d.Shape2D |
|---|
ACCURACY, defaultClipWindow, EMPTY_SET |
| Constructor Summary | |
|---|---|
MultiPolygon2D()
|
|
MultiPolygon2D(ClosedPolyline2D polyline)
|
|
MultiPolygon2D(java.util.Collection<ClosedPolyline2D> lines)
|
|
MultiPolygon2D(Polygon2D polygon)
|
|
| Method Summary | |
|---|---|
void |
addPolygon(Polygon2D polygon)
|
void |
addPolyline(ClosedPolyline2D polyline)
|
MultiPolygon2D |
clip(Box2D box)
Returns a new instance of MultiPolygon2D. |
boolean |
contains(double x,
double y)
|
boolean |
contains(double xr,
double yr,
double wr,
double hr)
|
boolean |
contains(java.awt.geom.Point2D point)
|
boolean |
contains(java.awt.geom.Rectangle2D rect)
|
BoundarySet2D<ClosedPolyline2D> |
getBoundary()
returns the boundary of the set. |
Box2D |
getBoundingBox()
Returns the bounding box of the shape. |
java.awt.Rectangle |
getBounds()
|
java.awt.geom.Rectangle2D |
getBounds2D()
|
MultiPolygon2D |
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.util.Collection<LineSegment2D> |
getEdges()
Return the edges as line segments of the polygon |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at)
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at,
double fl)
|
java.util.Collection<Polygon2D> |
getPolygons()
Return the set of (oriented) polygons forming this MultiPolygon2D. |
java.util.Collection<Point2D> |
getVertices()
Return the vertices (singular points) of the polygon |
int |
getVerticesNumber()
Return the number of vertices of the polygon |
boolean |
intersects(double xr,
double yr,
double wr,
double hr)
|
boolean |
intersects(java.awt.geom.Rectangle2D rect)
|
boolean |
isBounded()
Returns true if the shape is bounded, that is if we can draw a finite rectangle enclosing the shape. |
MultiPolygon2D |
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 |
| Constructor Detail |
|---|
public MultiPolygon2D()
public MultiPolygon2D(ClosedPolyline2D polyline)
public MultiPolygon2D(Polygon2D polygon)
public MultiPolygon2D(java.util.Collection<ClosedPolyline2D> lines)
| Method Detail |
|---|
public void addPolygon(Polygon2D polygon)
public java.util.Collection<Polygon2D> getPolygons()
public void addPolyline(ClosedPolyline2D polyline)
public BoundarySet2D<ClosedPolyline2D> getBoundary()
Domain2DThe returned curve is oriented, with an interior and an exterior.
getBoundary in interface Domain2Dpublic java.util.Collection<LineSegment2D> getEdges()
PolygonalShape2D
getEdges in interface PolygonalShape2Dpublic java.util.Collection<Point2D> getVertices()
PolygonalShape2D
getVertices in interface PolygonalShape2Dpublic int getVerticesNumber()
PolygonalShape2D
getVerticesNumber in interface PolygonalShape2Dpublic Box2D getBoundingBox()
Shape2D
getBoundingBox in interface Shape2Dpublic MultiPolygon2D getClippedShape(Box2D box)
public MultiPolygon2D clip(Box2D box)
clip in interface Shape2Dbox - the clipping box
public double getDistance(java.awt.geom.Point2D p)
Shape2D
getDistance in interface Shape2D
public double getDistance(double x,
double y)
Shape2D
getDistance in interface Shape2Dpublic boolean isBounded()
Shape2D
isBounded in interface Shape2Dpublic MultiPolygon2D transform(AffineTransform2D trans)
Shape2D
transform in interface PolygonalShape2Dtransform in interface Shape2Dtrans - an affine transform
public boolean contains(java.awt.geom.Point2D point)
contains in interface java.awt.Shape
public boolean contains(double x,
double y)
contains in interface java.awt.Shapepublic boolean contains(java.awt.geom.Rectangle2D rect)
contains in interface java.awt.Shape
public boolean contains(double xr,
double yr,
double wr,
double hr)
contains in interface java.awt.Shapepublic java.awt.Rectangle getBounds()
getBounds in interface java.awt.Shapepublic java.awt.geom.Rectangle2D getBounds2D()
getBounds2D in interface java.awt.Shapepublic java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
getPathIterator in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at,
double fl)
getPathIterator in interface java.awt.Shapepublic boolean intersects(java.awt.geom.Rectangle2D rect)
intersects in interface java.awt.Shape
public boolean intersects(double xr,
double yr,
double wr,
double hr)
intersects in interface java.awt.Shape
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||