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()
Polygon2D
public CirculinearDomain2D transform(CircleInversion2D inv)
CirculinearShape2D
transform
in interface CirculinearDomain2D
transform
in interface CirculinearShape2D
inv
- the circle inversionpublic CirculinearDomain2D getBuffer(double dist)
CirculinearShape2D
getBuffer
in interface CirculinearShape2D
dist
- the maximal distance between a point of the buffer and the
shapepublic CirculinearBoundarySet2D<LinearRing2D> getBoundary()
Domain2D
The returned curve is oriented, with an interior and an exterior.
getBoundary
in interface CirculinearDomain2D
getBoundary
in interface Domain2D
getBoundary
in interface Polygon2D
public Polygon2D complement()
Domain2D
complement
in interface Domain2D
complement
in interface Polygon2D
public Collection<LineSegment2D> getEdges()
Polygon2D
public int getEdgeNumber()
Polygon2D
getEdgeNumber
in interface Polygon2D
public Collection<Point2D> getVertices()
Polygon2D
getVertices
in interface Polygon2D
public Point2D getVertex(int i)
public int getVertexNumber()
Polygon2D
getVertexNumber
in interface Polygon2D
public Box2D getBoundingBox()
Shape2D
getBoundingBox
in interface Shape2D
public MultiPolygon2D clip(Box2D box)
public double getDistance(Point2D p)
Shape2D
getDistance
in interface Shape2D
public double getDistance(double x, double y)
Shape2D
getDistance
in interface Shape2D
public boolean isBounded()
Shape2D
public boolean isEmpty()
public MultiPolygon2D transform(AffineTransform2D trans)
Shape2D
public boolean contains(Point2D point)
Shape2D
public boolean contains(double x, double y)
Shape2D
public void draw(Graphics2D g2)
Domain2D
public void fill(Graphics2D g)
Domain2D
public MultiPolygon2D clone()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.