public class MultiPolygon2D extends Object implements Domain2D, Polygon2D
| Constructor and Description |
|---|
MultiPolygon2D() |
MultiPolygon2D(Collection<LinearRing2D> lines) |
MultiPolygon2D(LinearRing2D ring) |
MultiPolygon2D(LinearRing2D[] rings) |
MultiPolygon2D(SimplePolygon2D polygon) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPolygon(SimplePolygon2D polygon) |
void |
addPolyline(LinearRing2D ring)
Deprecated.
|
void |
addRing(LinearRing2D ring) |
MultiPolygon2D |
clip(Box2D box)
Returns a new instance of MultiPolygon2D.
|
MultiPolygon2D |
clone() |
Polygon2D |
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 point)
Checks if the shape contains the given point.
|
void |
draw(Graphics2D g2)
Draws the boundary of the domain, using current Stroke and color.
|
boolean |
equals(Object obj) |
void |
fill(Graphics2D g)
Fills the interior of the domain, using the Graphics current Paint.
|
CirculinearBoundarySet2D<LinearRing2D> |
getBoundary()
Returns the boundary of the set.
|
Box2D |
getBoundingBox()
Returns the bounding box of the shape.
|
CirculinearDomain2D |
getBuffer(double dist)
Computes the buffer of the shape, formed by the set of points located
at a distance from the shape that is lower or equal to d.
|
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.
|
int |
getEdgeNumber()
Returns the number of edges of the polygon
|
Collection<LineSegment2D> |
getEdges()
Return the edges as line segments of the polygon
|
Collection<SimplePolygon2D> |
getPolygons()
Return the set of (oriented) polygons forming this MultiPolygon2D.
|
Collection<LinearRing2D> |
getRings()
Returns the set of rings comprising the boundary of this polygon.
|
Point2D |
getVertex(int i)
Returns the i-th vertex of the polygon.
|
int |
getVertexNumber()
Returns the number of vertices of the polygon
|
Collection<Point2D> |
getVertices()
Returns the vertices (singular points) of the polygon
|
boolean |
isBounded()
Returns true if the shape is bounded, that is if we can draw a finite
rectangle enclosing the shape.
|
boolean |
isEmpty()
The MultiPolygon2D is empty either if it contains no ring, or if all
rings are empty.
|
MultiPolygon2D |
transform(AffineTransform2D trans)
Transforms the shape by an affine transform.
|
CirculinearDomain2D |
transform(CircleInversion2D inv)
Transforms the shape by a circle inversion.
|
public MultiPolygon2D()
public MultiPolygon2D(LinearRing2D ring)
public MultiPolygon2D(LinearRing2D[] rings)
public MultiPolygon2D(SimplePolygon2D polygon)
public MultiPolygon2D(Collection<LinearRing2D> lines)
public void addPolygon(SimplePolygon2D polygon)
public Collection<SimplePolygon2D> getPolygons()
@Deprecated public void addPolyline(LinearRing2D ring)
public void addRing(LinearRing2D ring)
public Collection<LinearRing2D> getRings()
Polygon2Dpublic CirculinearDomain2D transform(CircleInversion2D inv)
CirculinearShape2Dtransform in interface CirculinearDomain2Dtransform in interface CirculinearShape2Dinv - the circle inversionpublic CirculinearDomain2D getBuffer(double dist)
CirculinearShape2DgetBuffer in interface CirculinearShape2Ddist - the maximal distance between a point of the buffer and the
shapepublic CirculinearBoundarySet2D<LinearRing2D> getBoundary()
Domain2DThe returned curve is oriented, with an interior and an exterior.
getBoundary in interface CirculinearDomain2DgetBoundary in interface Domain2DgetBoundary in interface Polygon2Dpublic Polygon2D complement()
Domain2Dcomplement in interface Domain2Dcomplement in interface Polygon2Dpublic Collection<LineSegment2D> getEdges()
Polygon2Dpublic int getEdgeNumber()
Polygon2DgetEdgeNumber in interface Polygon2Dpublic Collection<Point2D> getVertices()
Polygon2DgetVertices in interface Polygon2Dpublic Point2D getVertex(int i)
public int getVertexNumber()
Polygon2DgetVertexNumber in interface Polygon2Dpublic Box2D getBoundingBox()
Shape2DgetBoundingBox in interface Shape2Dpublic MultiPolygon2D clip(Box2D box)
public double getDistance(Point2D p)
Shape2DgetDistance in interface Shape2Dpublic double getDistance(double x,
double y)
Shape2DgetDistance in interface Shape2Dpublic boolean isBounded()
Shape2Dpublic boolean isEmpty()
public MultiPolygon2D transform(AffineTransform2D trans)
Shape2Dpublic boolean contains(Point2D point)
Shape2Dpublic boolean contains(double x,
double y)
Shape2Dpublic void draw(Graphics2D g2)
Domain2Dpublic void fill(Graphics2D g)
Domain2Dpublic MultiPolygon2D clone()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.